Use VBA to set form control to value in a non-master/child subform?

Joined
Jul 17, 2009
Messages
1
Reaction score
0
Hello,

I am relatively new to making input forms and I am having trouble with a form control.

I am using Access 2007, and have setup an input form that views a subform. This subform is populated by a query linked to a table that is itself linked to an external Excel file.

I use the default Access 2007 search box in the navigation pain of the subform. I did this because I want the users to be able to search by DOB, first, last, middle name or title and it was easy. So the subform *works*.

My problem is that I want to improve this input form so that when the user brings up a record in the subform (which is in single record view), Access automatically takes the record's ID number from the subform and inserts it into the ID control in the input form.

The table I am inputing to holds payment information. The subform shows demographic information.

These tables are not linked in any way. I am fairly certain that I am not allowed by Access to setup any table relationships between them because one of the tables is linked to an external excel file.

Is there a way to do this with VBA, or a Macro, or any other method? Or should I resign myself to having the users cut and paste the ID number from the subform to the main form? It seems like this should be unnecessary.

Thank you for any advice you can give me!

-Matt
 

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

Top