forms and lookup tables

D

dana

Hi, I created a form where I want to enter personal
information and standard memos from a list on a particular
person. I have several fields in my table that the form is
based on. 3 of the fields are combo boxes that allow
choosing from abbreviated values from a lookup table. I
created 3 other fields and I wanted to program each field
so that it automatically display the memo that is included
for each of the three combo boxes. SO I have something
like this: In fields one,two, and three a person can
scroll through the combo box and pick from A B C .... etc.
where these values come from a lookup table. Then I want
memo1, memo2, memo3 to display the corresponding memos
based on what was chosen in one, two, three. So if one = B
for example, memo1 would automatically display the text
message for that particular selection.
I tried using Dlookup function like
memo1=Dlookup("[memo]","[tblMemos]","[one]=[one]") but I
got #Name in the text box. Is there any other simple way
to do this?

Thanx
 
J

Jonathan Parminter

-----Original Message-----
Hi, I created a form where I want to enter personal
information and standard memos from a list on a particular
person. I have several fields in my table that the form is
based on. 3 of the fields are combo boxes that allow
choosing from abbreviated values from a lookup table. I
created 3 other fields and I wanted to program each field
so that it automatically display the memo that is included
for each of the three combo boxes. SO I have something
like this: In fields one,two, and three a person can
scroll through the combo box and pick from A B C .... etc.
where these values come from a lookup table. Then I want
memo1, memo2, memo3 to display the corresponding memos
based on what was chosen in one, two, three. So if one = B
for example, memo1 would automatically display the text
message for that particular selection.
I tried using Dlookup function like
memo1=Dlookup("[memo]","[tblMemos]","[one]=[one]") but I
got #Name in the text box. Is there any other simple way
to do this?

Thanx
Hi dana,
set up comboboxes to include associated memo field as
hidden column (column width=0) and then use the
afterupdate event of combobox to update the memo textbox.
Use the following code as an example.

private sub comboboxOne_AfterUpdate()
memoOne=comboboxOne.column(1)
end if

replace memoOne with name of memo field and comboboxOne
with name of combobox. Note that column(1) is the second
column.

Luck
Jonathan
 
D

dana

Hello, thanks for the response. I tried what you said,
but when I tried to create the combo box to include the
associated memo field the wizard did not allow me to
include that as a column. I am guessing that this is
because this is a memo field and maybe it is too large for
a combo box. Is there any way to get around that?
If not, I also tried something else where I created an
option group where a person can check A B C etc. Of course
in the option group each value is stored as a number. I
tried to write a code where the corresponding memo would
be looked up from the Lookup table and it was something
like this: "IFF([one]=1, [memo1]=[tblmemos].[memo])" This
was also not very successful. Any suggestions or ideas are
much appreciated.

Thank you!
-----Original Message-----
-----Original Message-----
Hi, I created a form where I want to enter personal
information and standard memos from a list on a particular
person. I have several fields in my table that the form is
based on. 3 of the fields are combo boxes that allow
choosing from abbreviated values from a lookup table. I
created 3 other fields and I wanted to program each field
so that it automatically display the memo that is included
for each of the three combo boxes. SO I have something
like this: In fields one,two, and three a person can
scroll through the combo box and pick from A B C .... etc.
where these values come from a lookup table. Then I want
memo1, memo2, memo3 to display the corresponding memos
based on what was chosen in one, two, three. So if one = B
for example, memo1 would automatically display the text
message for that particular selection.
I tried using Dlookup function like
memo1=Dlookup("[memo]","[tblMemos]","[one]=[one]") but I
got #Name in the text box. Is there any other simple way
to do this?

Thanx
Hi dana,
set up comboboxes to include associated memo field as
hidden column (column width=0) and then use the
afterupdate event of combobox to update the memo textbox.
Use the following code as an example.

private sub comboboxOne_AfterUpdate()
memoOne=comboboxOne.column(1)
end if

replace memoOne with name of memo field and comboboxOne
with name of combobox. Note that column(1) is the second
column.

Luck
Jonathan
.
 

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