fluffyozzy
Registered User.
- Local time
- Today, 13:14
- Joined
- May 29, 2004
- Messages
- 63
Hi guys and girls,
What is the correct way to refer to a combobox column in vba? I'm trying to reference a combobox column on a form as a parameter in dcount statement but it's not working. It's probably something really simple but totally stumped me.
This works:
CountOfID = DCount("[PersonID]", "tblResponse", "[PersonID] = Forms!frmMain!frmMainHold!frmPerson!PersonID AND [QstID] = 1")
But this doesn't and this is the one I need:
cmbValue = Forms!frmMain!frmMainHold!frmPerson!cmbOpenDataForm!Column(0)
CountOfID = DCount("[PersonID]", "tblResponse", "[PersonID] = Forms!frmMain!frmMainHold!frmPerson!PersonID AND Forms!frmMain!frmMainHold!frmPerson!cmbOpenDataForm = cmbValue")
Can you help please? Many thanks in advance
What is the correct way to refer to a combobox column in vba? I'm trying to reference a combobox column on a form as a parameter in dcount statement but it's not working. It's probably something really simple but totally stumped me.
This works:
CountOfID = DCount("[PersonID]", "tblResponse", "[PersonID] = Forms!frmMain!frmMainHold!frmPerson!PersonID AND [QstID] = 1")
But this doesn't and this is the one I need:
cmbValue = Forms!frmMain!frmMainHold!frmPerson!cmbOpenDataForm!Column(0)
CountOfID = DCount("[PersonID]", "tblResponse", "[PersonID] = Forms!frmMain!frmMainHold!frmPerson!PersonID AND Forms!frmMain!frmMainHold!frmPerson!cmbOpenDataForm = cmbValue")
Can you help please? Many thanks in advance