questions.. please help!!

jim84

Registered User.
Local time
Today, 21:22
Joined
Nov 4, 2002
Messages
23
Hello, im just starting out with access so apologies if my question is embarassingly basic!

Q Im creating a form which consists of user name, first name and surname (all of this data is in a table called staff). In the form, I've made the user name a combo box so that you can choose the correct username from a drop down list. The problem is I cant make the first name and surname boxes automatically populate with the correct information once a username is chosen, they just stay the same as they were before.

Please please help, again sorry if its really simple, im a newbie!

Thanks - Jim.


P.SQ for future reference, would it be simpler to have a seperate form for inputting new user data or can i ammend the one ive just been talking about to do that job too? Thanks again.
 
Last edited:
I *think* you'll need to use a requery statement linked to the AfterUpdate event on the surname box.
 
Usually in a combo you make the first column the primary key, but hidden. You can also add more columns and hide these, so you could include first name and surname as columns 3 & 4 and set these columns as the data source for your text boxes. Bear in mind that the column numbers start from 0 so the syntax would be:
=Me.MyCombo.Column(2)
=Me.MyComb0.Column(3)
 
thank you very much for the help, just one more question. How do you set a data source for a text box? thank you again :)
 
Open the properties sheet for the text box and put the code into Control Source.
 
Thanks. I tried that but the boxes just have " #Name? " as text. Hmmm any advice?!
 
What have you typed in? You have to substitute the actual name of the combo box for MyCombo.
 
I've typed in:

=Me.Combo8.Column(1)

for first name, in the control source. when i switch to view mode it just has #Name? despite whats being clicked on in the combo box.
 
Its all good, i got it working eventually, turns out i was putting the code in the wrong place.... haha whoops. Thanks for all the help mate, really appreciate it :)
 

Users who are viewing this thread

Back
Top Bottom