Dlookup

RitaG

New member
Local time
Today, 13:42
Joined
Apr 21, 2001
Messages
5
Hi -
Hope this add'l info helps.

ClientID field has combo box from another table. Added after event to combo box under the event procedure. (data in combo box is text)

Firstname field has Dlookup function in Property Control Source.

Both fields are unbound.

When I input a client ID it correctly puts the first name in the firstname field. I then enter more data and am ready to create new record. (i.e. I entered ID as P1234 and it correctly put Paul in firstname field.)I then go to create a new record. In the new record G1234 & Paul are already showing up. I change the ID i.e. J5678 and it enters Jane. If I go back to 1st record the ID has changed to J5678 and name to Jane. If I had a dozen records they would all have the ID and name of my last entry.

Hope this helps you enough to help me. I guess this wasn't the thing for a person new to Access to try to tackle.

Thanks much,
Rita

P.S. tried suggestion under message "populate form fields from combo boxes". Had the same problem.


[This message has been edited by RitaG (edited 04-22-2001).]
 
Rita -

If the fields on your form are unbound then the data put into those fields cannot be saved to your table.

Let me assume that your table (I will call it Table1) has only two fields, ClientID and FirstName. Let me also assume that your combo box has two fields; ClntID and FName.

Form1 is based on Table1 and the two fields on the form are bound to the two fields on the Table. Therefore the Control Source for the ClientID should read ClientID and the other fields Control Source should be FirstName. ClientID is actually a Combo Box with two fields and the Bound Column in the combo box is 1. This means that the ClntID that you chose from the Combo box will be saved in the ClientID field in Table1. In the After Update event of the Combo box you should have code that reads:

Me![FieldName] = Me![ComboBoxName].Column(1)

When you go to a new record in Form1, select a ClientID from the Combo Box the ClientID and the FirstName should be saved in that record.

If this does not clear up your problem I am willing to look at your database if you feel comfortable doing that. Just zip it up and email it to me.

Hope this helps....

Jack
 

Users who are viewing this thread

Back
Top Bottom