opening data entry form with appropriate client ID fillied in...

G

Guest

I have 2 tables tblClient and tblClientAppointment related in 1:many. The key
foreign / foreign field is a text field called clientID (not an autonumber).
I have 2 forms based on these tables. I would like to open a data entry form
regarding client appointment information and have the current clients
clientID appear in the data entry form. I have tried using the defaulvalue
property (see below) which should work but for some reason isn't

Private Sub Form_Open
me.clientID.DefaultValue = Forms!frmClient!ClientID
End Sub

when I open the form (using a button on the frmClient form the client ID has
"#Name?". The form frmClient is open. What am I doing wrong or is there a
better way of opening a data entry field an having the foreign key filled in
programatically based on the client form clientID. Thanks for any help.
 
G

Guest

For a text field try adding a single quote before and after

me.clientID.DefaultValue = "'" & Forms!frmClient!ClientID & "'"
 

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

Similar Threads


Top