chrismcbride
Registered User.
- Local time
- Today, 11:15
- Joined
- Sep 7, 2000
- Messages
- 301
I am really not sure what the Debug Menu command 'Complile All Modules' is supposed to do, however I am trying to use it as a way to test the integrity of the coding on my forms.
Anyway the problem I have is with compiling parts of my code that have SQL strings. For example I have a number of DoCmd.RunSql commands that create records automatically. The compiler will stop on a field name like...
me.inv_no and say "Method or Data member not found"
...
I have of course checked to see if the field name is correct (and it is) and furthermore the compiler will allow the same reference in a later bit of code (only to trip on another field name).
I imagine that there is some problem with the SQL string itself, however they run in the procedures that hold them and, once they have been adapted to run from the QBE, they also run. Could it have something to do with the enclosing of strings within the SQL string. Or can any one think of some other reason?
I have enclosed a string that the compiler trips on...
DoCmd.RunSQL "INSERT INTO tblInvoice (cust_no, admin_no, cust_po, inv_date, " _
& "file_no, inv_address, inv_exchange, void, credit_note, gst, pst, ship, " _
& "discount, cfi, id_string, cont_no, inv_cur) VALUES (" _
& Me.cboCustomer & ", " & Me.cboAdmin & ", '" & Me.cust_po & "', #" _
& Me.inv_date & "#, '" & Me.id_string & Me.inv_no & "', " & Me.inv_address _
& ", " & Forms!frmConfig_Payable_Invoice!invExchange _
& ", 0, -1, " & Me.chkGST & ", " & Me.chkPST & ", " & Me.ship _
& ", " & Me.discount_rate & ", " & Me.cfi & ", 'CRE-', " & Me.cont_no _
& ", " & Me.inv_cur & ");"
By the way it may help to know that in this case the compiler trips on the reference to...
me.invExchange
... In fact, I have tried to rename the feild, with no change.
Thanks in advance
Chris
[This message has been edited by chrismcbride (edited 05-16-2001).]
Anyway the problem I have is with compiling parts of my code that have SQL strings. For example I have a number of DoCmd.RunSql commands that create records automatically. The compiler will stop on a field name like...
me.inv_no and say "Method or Data member not found"
...
I have of course checked to see if the field name is correct (and it is) and furthermore the compiler will allow the same reference in a later bit of code (only to trip on another field name).
I imagine that there is some problem with the SQL string itself, however they run in the procedures that hold them and, once they have been adapted to run from the QBE, they also run. Could it have something to do with the enclosing of strings within the SQL string. Or can any one think of some other reason?
I have enclosed a string that the compiler trips on...
DoCmd.RunSQL "INSERT INTO tblInvoice (cust_no, admin_no, cust_po, inv_date, " _
& "file_no, inv_address, inv_exchange, void, credit_note, gst, pst, ship, " _
& "discount, cfi, id_string, cont_no, inv_cur) VALUES (" _
& Me.cboCustomer & ", " & Me.cboAdmin & ", '" & Me.cust_po & "', #" _
& Me.inv_date & "#, '" & Me.id_string & Me.inv_no & "', " & Me.inv_address _
& ", " & Forms!frmConfig_Payable_Invoice!invExchange _
& ", 0, -1, " & Me.chkGST & ", " & Me.chkPST & ", " & Me.ship _
& ", " & Me.discount_rate & ", " & Me.cfi & ", 'CRE-', " & Me.cont_no _
& ", " & Me.inv_cur & ");"
By the way it may help to know that in this case the compiler trips on the reference to...
me.invExchange
... In fact, I have tried to rename the feild, with no change.
Thanks in advance
Chris
[This message has been edited by chrismcbride (edited 05-16-2001).]