Hi Linkset
Firstly, I think the guy's name is DonQ but... 8o)
Anyway, as for your problem, the simplest way is to create a popup form with one textbox (txtData) and 15 buttons as follows
10 buttons labeled 0 to 9
1 button labeled "." (decimal point)
1 button for backspace (labeled del?"
1 button labeled Clear to clear the textbox
1 button labeled Cancel to close the form without making changes
1 button labeled OK to close the form and insert the data.
You will also need a public string variable in the keypad form:
public strCallingField as string
This identifies which field is calling the keypad.
The code for the number buttons would be:
addchar(0) 'for the Zero button
Each button would add a different character.
The addchar function is simple:
private function addchar(strChar as variant) as string
me.txtData = me.txtData & strChar
end function
For the Decimal Point Button:
me.txtData = me.TxtData & "."
You might want to check if there's already a decimal point with
if instr(me.txtData,".") =0 then
me.txtData = me.txtData & "."
endif
For the backspace button (Del):
me.txtData = left(me.txtData,len(txtData -1))
For the Clear button:
me.txtData = ""
For the cancel button:
RunCommand acCmdClose
For the OK Button
forms!(strCallingField)= txtData
RunCommand acCmdClose
more...