Form – Field entry to remain.

gsandy

Registered User.
Local time
Tomorrow, 04:57
Joined
May 4, 2014
Messages
104
I have a combo box in a form to select a name from a dropdown list. How can I get the last selected name to remain in the comb box when moving to a new entry? I wish the last selected name to remain until a new one is selected.


Thanks Sandy
 
I have added the following code:

Code:
Private Sub Staff_ID_AfterUpdate()

Const Staff_ID = """"  'Thats two quotes
    Me!Control.DefaultValue = Staff_ID & Me!Control.Value & Staff_ID

End Sub
Where Staff_ID is the name of the combo box that links to my staff table.
It is not working for some reason?
 
Try

Code:
Private Sub Staff_ID_AfterUpdate()

  Const cQuote= """"  'Thats two quotes
  Me!Staff_ID.DefaultValue = cQuote & Me!Staff_ID.Value & cQuote

End Sub
 
Still got problems.
I get a run time error 2465, stating Access cant find Staff_ID which is the name of the combo box and the name of the field in the table.
 
Can you post the db here?
 
File attached. It is a bit messy at the moment, its my first time creating an Access database. Learning as I go!
 

Attachments

The combo (and field) name has an inadvisable dash, not an underscore:

Staff-ID
 
I have changed the dash to underscore.
We have partial success!
The Staff_ID remained with the new entry. But the textboxes with FirstName and LastName were blank until I tabbed into that textbox and then the relative name appeared. How do I get the names to stay with the new entry?
 
Hi Paul (Baldy), the problem seems to have solved itself! Its working fine now, thanks. Cheers Sandy
 

Users who are viewing this thread

Back
Top Bottom