Romper
Registered User.
- Local time
- Today, 19:59
- Joined
- Oct 28, 2012
- Messages
- 83
Hi all,
Okay, here's the scenario. I have a database for a stamp collection. I have a table named "CWused" with records data for Commonwealth used stamps. I have a form for this table called "CW Used Stamps". One of the combo boxes on the form looks up another table called "CW Countries". Within this table, there is only three columns "ID" "Country" & "CountryCode". Okay, so on the form, the combo box looks up the "Country". I need to create a field that will return the value of the "CountryCode" for the "Country" I have selected on the form. I only need the "CountryCode to appear visually, then I will use that code added to a catalogue number to create a unique name for the individual stamp. This will be typed into a totally different field.
I have exhausted tutorials, books and help screens but cannot get it to work. What should my ControlSource for the text box look like? Does it matter that the form name has spaces in it's name?
Should the following be correct?
=DLookup("[CountryCode]", "CW Countries", "[Country] = " & Forms![CW Used Stamps]![Country])
How critical are spaces in names as well as the syntax? I have tried this so many ways?
Please show me the correct ControlSource.
In desperation.......
Okay, here's the scenario. I have a database for a stamp collection. I have a table named "CWused" with records data for Commonwealth used stamps. I have a form for this table called "CW Used Stamps". One of the combo boxes on the form looks up another table called "CW Countries". Within this table, there is only three columns "ID" "Country" & "CountryCode". Okay, so on the form, the combo box looks up the "Country". I need to create a field that will return the value of the "CountryCode" for the "Country" I have selected on the form. I only need the "CountryCode to appear visually, then I will use that code added to a catalogue number to create a unique name for the individual stamp. This will be typed into a totally different field.
I have exhausted tutorials, books and help screens but cannot get it to work. What should my ControlSource for the text box look like? Does it matter that the form name has spaces in it's name?
Should the following be correct?
=DLookup("[CountryCode]", "CW Countries", "[Country] = " & Forms![CW Used Stamps]![Country])
How critical are spaces in names as well as the syntax? I have tried this so many ways?
Please show me the correct ControlSource.
In desperation.......
Last edited: