G
Guest
Hi,
I have 2 Combo boxes in a form. One of the combo boxes is attached directly
to a field in a table. I would like to populate my second combo box according
to which value the user chooses.
To make this I have written the following code.
Dim dbrecs As DAO.Database
Dim rstrecs As DAO.Recordset
Dim STRsql As String
Private Sub cmb_sender_Change()
STRsql = "SELECT Reciever.Rec_Company, Reciever.Rec_Destination_Code,
Reciever.Rec_ID FROM Reciever WHERE Reciever.Shipp_Account = '" &
Me.cmb_sender.Value & "'"
Set rstrecs = dbrecs.OpenRecordset(STRsql, dbOpenDynaset)
However when I try to run this code the followingerror message will come
up:- "Object variable or With block variable not set".
I know this might sound stupid but I am a bit of a newbee here and have
spent a lot of time trying to solve this problem.
Thanks
Gordon
I have 2 Combo boxes in a form. One of the combo boxes is attached directly
to a field in a table. I would like to populate my second combo box according
to which value the user chooses.
To make this I have written the following code.
Dim dbrecs As DAO.Database
Dim rstrecs As DAO.Recordset
Dim STRsql As String
Private Sub cmb_sender_Change()
STRsql = "SELECT Reciever.Rec_Company, Reciever.Rec_Destination_Code,
Reciever.Rec_ID FROM Reciever WHERE Reciever.Shipp_Account = '" &
Me.cmb_sender.Value & "'"
Set rstrecs = dbrecs.OpenRecordset(STRsql, dbOpenDynaset)
However when I try to run this code the followingerror message will come
up:- "Object variable or With block variable not set".
I know this might sound stupid but I am a bit of a newbee here and have
spent a lot of time trying to solve this problem.
Thanks
Gordon