By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,655 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,655 IT Pros & Developers. It's quick & easy.

Autofill problem

P: 11
I've searched through some of the answers on the forum regarding autofill but I can't work out how to do it for my database.

I have two tables
1. Members info, containing the following fields:
a. Member ID (primary)
b. Division that the member belongs in
c. Address
d. Names

2. Division Night info containing the following fields:
a. Which Division is holding training night (
b. Members who attended (Member ID) as a combo box
c. Visitor or Member of the specific Division

One-To-Many relationship is set up between 1a and 2b

My question is how do i set up the database on the form so that when i select 2a and 2b, then 2c automatically comes up?

2c is worked out by looking at the member ID in 1a and if the division that the member belongs to (1b) is the same as the division holding the training night (2a), then 2c's answer is a 'Member'?

Thanks
Dec 21 '06 #1
Share this Question
Share on Google+
3 Replies


P: 11
I know it has something to do with Dlookup but i dont know how to use the function.
Dec 21 '06 #2

P: 11
I have two tables with the following field names
1. Members info, containing the following fields (tbl01MembersDetail):
a. Member ID (primary) - lngMemberNum
b. Division that the member belongs in - strDivisionName
c. Address
d. Names

2. Division Night info containing the following fields:
a. Which Division is holding training night
b. Members who attended (Member ID) as a combo box - LngMemberID
c. Visitor or Member of the specific Division

In 2b's combo box after-update feature, i've added this code:
test = DLookup ([strDivisionName], "tbl01MembersDetail",[lngMemberNum] = LngMemberID)

I just used "test" to see if the result gives me the division that the member belongs to, which i can then compare and determine whether the member is a visitor to the division holding the training night.

Sorry if it's all very confusing, it is like that for me.
Dec 21 '06 #3

P: 11
I have two tables with the following field names
1. Members info, containing the following fields (tbl01MembersDetail):
a. Member ID (primary) - lngMemberNum
b. Division that the member belongs in - strDivisionName
c. Address
d. Names

2. Division Night info containing the following fields:
a. Which Division is holding training night
b. Members who attended (Member ID) as a combo box - LngMemberID
c. Visitor or Member of the specific Division

In 2b's combo box after-update feature, i've added this code:
test = DLookup ([strDivisionName], "tbl01MembersDetail",[lngMemberNum] = LngMemberID)

I just used "test" to see if the result gives me the division that the member belongs to, which i can then compare and determine whether the member is a visitor to the division holding the training night.

Sorry if it's all very confusing, it is like that for me.
FOUND THE ANSWER, I HAD THE QUOTATION MARKS IN THE WRONG PLACE!
Dec 21 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.