Truncating zero's off the front of an ID number

S

Steve

I'm using a user entered clientID number (as a text field
since it is not required for calculations) as the primary
Key in a tblClient. The tblClient and tblClientEvent are
set up in a one to many relationship using clientID as the
link. Forms frmClient and fsubClientEvent are linked by
the clientID number. I have written a code in the "on open
form" event that sets the ClientID default in
fsubClientEvent subform equal to the ClientID on the
frmClient parent form to keep the two forms synchronized.
In some instances, the clientID has zeros in the front.
When fsubClientEvent opens it truncates the zeros off the
front of the clientID number. Since it no longer matches
the true clientID an error message is generated, saying
there is no corresponding record in the tblClient table.
How can I prevent this from happening? Thanks
 
K

Ken Snell

Is the ClientID field in tblClientEvent formatted as text or as a number? It
needs to be formatted as a number.

Then, in fsubClientEvent subform, is the control that is bound to ClientID
also *not* formatted as a number? It needs to be a text format as well
(usually this will be ok if the field to which it's bound is formatted as
text and the Format property of the control is left blank.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top