Noob form question

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
 
A

Arvin Meyer [MVP]

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
 
M

missinglinq via AccessMonster.com

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
 
J

Joskin

Many thanks, Gents.

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

Rgds,
Joskin
 

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