C
Chris
Hello all.
I have two cbo boxes on a form (based on tables). The first cbo filters the
next cbo. the first contains Bank names and the second contains branches.
On the double click event of the cbo boxes I have the option of adding the
bank/branch to the table(s). I've used the following code to check of the
Bank is already in the table
If inList = IsNull(DLookup("[BankName]", "tblBanks", "[BankName]= " &
cboBankname.text)) Then
MsgBox "The bank already exists."
I would like the code to check if the branch exists too. However this is
creating problems as there may be two banks with the same branch name e.g.
Halifax / Glasgow , Bank of Scotland / Glasgow.
I'm pretty sure the way forward is to have some sort of where clause in the
'Crieria' section ( "[BankNameID]= " & cboBankname.value And "[Branch]= "
&cbobranch.text) , but, I do not know how to add it.
tblBanks
BankID - pk - An
BankName - str
tblBranch
BranchID - pk An
BankID - fk - An
BranchName - str
I have two cbo boxes on a form (based on tables). The first cbo filters the
next cbo. the first contains Bank names and the second contains branches.
On the double click event of the cbo boxes I have the option of adding the
bank/branch to the table(s). I've used the following code to check of the
Bank is already in the table
If inList = IsNull(DLookup("[BankName]", "tblBanks", "[BankName]= " &
cboBankname.text)) Then
MsgBox "The bank already exists."
I would like the code to check if the branch exists too. However this is
creating problems as there may be two banks with the same branch name e.g.
Halifax / Glasgow , Bank of Scotland / Glasgow.
I'm pretty sure the way forward is to have some sort of where clause in the
'Crieria' section ( "[BankNameID]= " & cboBankname.value And "[Branch]= "
&cbobranch.text) , but, I do not know how to add it.
tblBanks
BankID - pk - An
BankName - str
tblBranch
BranchID - pk An
BankID - fk - An
BranchName - str