presuming_ed
Registered User.
- Local time
- Today, 17:16
- Joined
- May 6, 2003
- Messages
- 23
Can anyone help? I'm running the following code:
' Find the email address appropriate to the current stock tracker record
strsql = "SELECT import_stock_data.store_number, import_stock_data.week, " _
& "import_stock_data.stock_data, lookup.email_address " _
& "FROM lookup INNER JOIN import_stock_data ON lookup.lstore_number = " _
& "import_stock_data.store_number " _
& "WHERE import_stock_data.store_number = '" & rst.Fields("store_number") & "';"
Set rst2 = db.OpenRecordset(strsql, dbOpenSnapshot)
If rst2!email_address = "" Then
MsgBox "null rst2"
Else
t_store_no = rst!store_number
t_email = rst2!email_address
t_stock_data = rst!stock_data
email_title = "Stock Tracker - Week " & rst!week & "Store " & rst!store_number
When I check whether rst!email_address is null i.e. whether there is an email address on my lookup table, I get a 3021 No current record message. How do I check whether a email address has been returned. I've tried using ISNULL against my recordset, and also tried NOMATCH but these don't work either.
Thanks.
' Find the email address appropriate to the current stock tracker record
strsql = "SELECT import_stock_data.store_number, import_stock_data.week, " _
& "import_stock_data.stock_data, lookup.email_address " _
& "FROM lookup INNER JOIN import_stock_data ON lookup.lstore_number = " _
& "import_stock_data.store_number " _
& "WHERE import_stock_data.store_number = '" & rst.Fields("store_number") & "';"
Set rst2 = db.OpenRecordset(strsql, dbOpenSnapshot)
If rst2!email_address = "" Then
MsgBox "null rst2"
Else
t_store_no = rst!store_number
t_email = rst2!email_address
t_stock_data = rst!stock_data
email_title = "Stock Tracker - Week " & rst!week & "Store " & rst!store_number
When I check whether rst!email_address is null i.e. whether there is an email address on my lookup table, I get a 3021 No current record message. How do I check whether a email address has been returned. I've tried using ISNULL against my recordset, and also tried NOMATCH but these don't work either.
Thanks.