R
Robin Donald
I am tearing my hair out! I would be deliriously happy if someone could
tell me what I am doing wrong.
I have code which creates price and barcode labels - and it works
perfectly and has done for years.
Now, I need to make the same set of stuff for labels in Euros, where
the customer wants labels in this currency.
So my code branches to a duplicated piece of code if the currency is
Euros and I have built identical sets of queries and temporary tables -
mostly by prefixing with the word "Euro" in the new versions.
I have checked (and double checked and triple checked!) all of the
spelling and swear that it is OK.
Part 1, below works perfectly.
11111111111111111111111111111111111111111
Dim qdfLabels_Green As QueryDef
Set qdfLabels_Green = db.QueryDefs("qryPot_Labels_Green_Generate")
qdfLabels_Green.Parameters![Get_Sales_Delivery_Number] =
Me.Sales_Delivery_Number
Set rstLabels_Green = qdfLabels_Green.OpenRecordset
Set rstLabel_Requests_Green =
db.OpenRecordset("Label_Requests_Green")
With rstLabels_Green
etc, etc,
11111111111111111111111111111111111111111
Part 2. - Basically a copy, produces the famous "Object variable or
With block variable not set" error and the error trapping kicks in when
it attempts to execute the second line,
(Set qdfEuro_Green_Labels = db.etc, etc)
22222222222222222222222222222222222222222
Dim qdfEuro_Green_Labels As QueryDef
Set qdfEuro_Green_Labels =
db.QueryDefs("qryEuro_Pot_Labels_Green_Generate")
qdfEuro_Green_Labels.Parameters![Get_Sales_Delivery_Number] =
Me.Sales_Delivery_Number
Set rstEuro_Green_Labels = qdfEuro_Green_Labels.OpenRecordset
Set rstEuro_Green_Label_Requests =
db.OpenRecordset("Euro_Green_Label_Requests")
With rstEuro_Green_Labels
etc, etc,
22222222222222222222222222222222222222222
All of the if/end, for/next with/endwith, etc stuff is AOK and it all
compiles perfectly.
Any pointers will be very gratefuly received.
Robin Donald
tell me what I am doing wrong.
I have code which creates price and barcode labels - and it works
perfectly and has done for years.
Now, I need to make the same set of stuff for labels in Euros, where
the customer wants labels in this currency.
So my code branches to a duplicated piece of code if the currency is
Euros and I have built identical sets of queries and temporary tables -
mostly by prefixing with the word "Euro" in the new versions.
I have checked (and double checked and triple checked!) all of the
spelling and swear that it is OK.
Part 1, below works perfectly.
11111111111111111111111111111111111111111
Dim qdfLabels_Green As QueryDef
Set qdfLabels_Green = db.QueryDefs("qryPot_Labels_Green_Generate")
qdfLabels_Green.Parameters![Get_Sales_Delivery_Number] =
Me.Sales_Delivery_Number
Set rstLabels_Green = qdfLabels_Green.OpenRecordset
Set rstLabel_Requests_Green =
db.OpenRecordset("Label_Requests_Green")
With rstLabels_Green
etc, etc,
11111111111111111111111111111111111111111
Part 2. - Basically a copy, produces the famous "Object variable or
With block variable not set" error and the error trapping kicks in when
it attempts to execute the second line,
(Set qdfEuro_Green_Labels = db.etc, etc)
22222222222222222222222222222222222222222
Dim qdfEuro_Green_Labels As QueryDef
Set qdfEuro_Green_Labels =
db.QueryDefs("qryEuro_Pot_Labels_Green_Generate")
qdfEuro_Green_Labels.Parameters![Get_Sales_Delivery_Number] =
Me.Sales_Delivery_Number
Set rstEuro_Green_Labels = qdfEuro_Green_Labels.OpenRecordset
Set rstEuro_Green_Label_Requests =
db.OpenRecordset("Euro_Green_Label_Requests")
With rstEuro_Green_Labels
etc, etc,
22222222222222222222222222222222222222222
All of the if/end, for/next with/endwith, etc stuff is AOK and it all
compiles perfectly.
Any pointers will be very gratefuly received.
Robin Donald