Noob form question

  • Thread starter Thread starter Joskin
  • Start date Start date
J

Joskin

Hello Gurus,

I have inherited a database (A2003):

Table1 is related to Table2, based on a UniqueName field in both tables.

Now, the form:

If you select a name in the combo box, based on Table1 UniqueName, then it
fills the other boxes with other information from Table1 relevant to the
UniqueName you selected - it works perfectly.

I would like to add an extra text box to the form which fills with info from
a field in Table2, again based on UniqueName.

Is this possible? If so, how do I specify that the data should come from a
different table? All my effort so far have resulted in the dreaded #Name?
error.

TIA
Joskin
 
You might try the afterupdate event in the combobox to do a lookup:

Sub mycombo_AfterUpdate()
Dim x As Variant

x = DLookup("FieldName", "Table2", "UniqueName = '" &
Forms!FormName!UniqueName& "'")

NewTextBox = x

End Sub
 
You need to base your form on a query that includes both tables, with the
tables joined by the UnigueName field.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
Many thanks, Gents.

I'll try your suggestions as soon as I've worked out how to do them.

Rgds,
Joskin
 
Back
Top