auto fill in form fields with table data

Rpm1957

Registered User.
Local time
Today, 01:39
Joined
Feb 3, 2012
Messages
19
I have 2 tables as below :

table1
TEMP PH4 PH7 PH10
30 4 7 7.9
20 6 8 9
10 7 7 7.9

table2
REC TEMP PH4 PH7 PH10
1
2
3

I also have a form relating to table 2 with a combobox for the temp on table1. how can i get the combobox selection to populate the other fields in the form and table2?
This is probably very easy however, having not touched access for some time (7years) I seem to be going round in circles can anyone help
Please
 
Your "going round in circles" is making me dizzy, too!

Your Database is about as Non-Normalized as any I've ever seen, violating the Cardinal Rule of Relational Databases, which is to never store a single piece of Data in more than one Table!

The only exception to this rule is a Field that is an Identification Field which is Unique and used to link one Table to one or more other Tables.

You have two Tables where all Fields are identical except for REC, which appears to be a Record Number. Given you presented Data, and assuming that there will only be one TEMP per one REC, you should only have a single Table, which is to say Table 2, containing all the Fields.

You can populate Unbound Controls with TEMP, PH4 , PH7, and PH10, in as many Forms as you wish, using a Combobox for Selecting the TEMP, assuming that TEMP is Unique.

I think you need to give a little more explanation of what you're trying to do here, in plain language, in order for us to help you.

Linq ;0)>
 
Sorry I have not explained very well, new to forums. thanks in advance for your help. I'll try again.

Table1 is used for the combo box on the form. Table2 is for the record storage there are more fields in table2 I just need help with the combo box.
What I am trying to do is when the user selects the temp from the combo box on the form it populates the related fields on the form i.e. PH4,PH7,PH10. I have managed to do this however when i look at the record on table2 the only field that has updated is the Temp the others PH4,PH7,PH10 are all blank. Am i going about this the wrong way?
 
tried this link and after entering the me.textbox etc command it says the macro does not exist?
 
Did you put it in the VBA editor (where it needs to be) or directly in the property window, where it will error?
 
tried this link and after entering the me.textbox etc command it says the macro does not exist?
As Paul has suggested, this type of error is almost always caused by entering code directly into the Property box rather than placing it in the Form's Code Module.

Linq ;0)>
 
I have placed it in the VBA editor but still the only field in table2 that stores data is the TEMP field the others are blank? incidentally I am using access 2000 if that makes any difference.
 
The code is not actually associated with the combo. Did you just type it in, or do it this way:

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

In any case, it would error because you have the formula in the control source of ph4 rather than the field name.
 
So can you tell me the answer or post back the database so that I can see what you mean?
 
I've given you the answer. Associate the code like the link in post 10 shows, and change the control source.
 
Thanks for your help. I think I finally got my head around it. (at last!!!)
You guys really know your stuff!!
 

Users who are viewing this thread

Back
Top Bottom