Hi
I am soooooo close to getting this data entry form complete. The Database keeps track of transactions in bank accounts with differing currencies. The exchange rate between currencies is recorded in tblFXRates and I have to check, before adding a record to tblTransactions, using the data entry form ppuNewCashTransaction, that an exchange rate has been entered for the Date and Currency of the transaction. There's lots of examples of this on the internet but I can't get any to work.
Here's the code:
I am entering this in the on_click event of a Command Button Control on the data entry form, right after I check to ensure that all the fields in the form have had values entered in them.
I get an Object Required error, on the line starting with "Set". Both qualifiers return values when I enter them in the Immediate Window and the spelling is correct for the table name and field being selected.
Any help would be appreciated, as always. Sooooooo close.
Thanks
A/R
I am soooooo close to getting this data entry form complete. The Database keeps track of transactions in bank accounts with differing currencies. The exchange rate between currencies is recorded in tblFXRates and I have to check, before adding a record to tblTransactions, using the data entry form ppuNewCashTransaction, that an exchange rate has been entered for the Date and Currency of the transaction. There's lots of examples of this on the internet but I can't get any to work.
Here's the code:
Code:
'Check if Query for FX is empty i.e.,No exchange rate in table for this currency on this date
Dim rst As Recordset
Set rst = db.OpenRecordset("SELECT tblFXRates.fxXRate " & vbCrLf & _
"FROM tblFXRates " & vbCrLf & _
"WHERE (((tblFXRates.fxDate)=[forms]![ppuNewCashTransaction]![txtTransDate]) AND ((tblFXRates.fxCurrency)=[forms]![ppuNewCashTransaction]![txtFXShortName]));")
If rst.EOF Then MsgBox "No FX Rate Exists"
Exit Sub
I am entering this in the on_click event of a Command Button Control on the data entry form, right after I check to ensure that all the fields in the form have had values entered in them.
I get an Object Required error, on the line starting with "Set". Both qualifiers return values when I enter them in the Immediate Window and the spelling is correct for the table name and field being selected.
Any help would be appreciated, as always. Sooooooo close.
Thanks
A/R