Save data from an autofilled text box to a table field

KEKeogh

Registered User.
Local time
Today, 15:42
Joined
May 4, 2011
Messages
80
OK, so I figured out how to get the [Driver Name] textbox to autofill with the correct name when the [Driver #] is selected in the dropdown box.

Now I'm wondering if there is a way to save that autofilled value in the textbox to the [Student Data] table under the [Driver Name] field?

The way I can use it in the report that already pulls from the [Student Data] table.

Thanks
Kathie
 
I've tried the after update link you gave me but it's still not working.

I changed [Text135]'s row source: [Driver Name] on the [Student Data] table

And I changed the [Driver #] combobox's After Update field to: Text135=[Driver #].Column(1)

I keep getting an error saying Access can't find the macro.

I've also tried linking the tables in a query but I think I'm doing something wrong there cause I'm either getting nothing or not all the student records which is what I'm pulling the driver info for.

Thanks for helping!

Kathie
 
What I posted was VBA code; it would go here:

http://www.baldyweb.com/FirstVBA.htm

You could also use a macro, using SetValue. That said, you generally shouldn't store the name in related tables. What are you going to do when Mary Smith gets married and changes her name to Mary Jones? You have to find every instance of the name and change it. With proper normalized design, you just change it in your drivers table and everyplace in the db gets it from there. If you want to post the query, we can try to figure out what's going wrong. Or post the db itself if feasible.
 
I was putting that "Text135=[Driver #].Column(1)" in the main Property Dialogue box for After Update. Once I put it in the Code Builder it worked perefectly.

It's not an issue on the names not updating. Even if a driver changes their name they don't usually driver that many of my students that it will be difficult to do a Find & Replace.

Thanks for all your help!!

Kathie
 
If you're happy I'm happy. Glad we got it working for you!
 

Users who are viewing this thread

Back
Top Bottom