How about this statement. I get a run-time error '2342'
A RunSQL action requires an argument consisting of an SQL statement.
DoCmd.RunSQL "SELECT t.[Report ID], f.[Full Field Name] FROM TESTTABLE t, TBL_FieldID f, TBL_Index i WHERE t.[Report ID]=i.[Report ID] AND f.[Field ID] = i.[Field ID]"
When I run the following SQL statement in the immediate window. I get the following error:
The SELECT statement includes a reserved word or an argument name that is mispelled or missing, or the punctuation is incorrect.
DoCmd.RunSQL " Select TESTTABLE t, TBL_FieldID f, TBL_Index i WHERE...
I tend to have problems with syntax when mixing strings with variables. For instance,
MsgBox "This is:" + variable
gives me a type mismatch error
or in a SQL statement. Can someone direct me to some Faq or other resource.
I notice when many members post code, they have a neat formatting trick which makes the code more readable on these post. Does anyone know how to perform that action.
This is SQL statement that I'm using in my code. RptValue, and X represent variable that I want to alter. This SQL statement will not put the constant into the SQL string. If I try to do something similar to the following ('RptValue','X')" then I get the words not values. Does anyone have a...
Will the GetAbsolutePathName method return directory of a shared folder. Different users in different regions access a database with different directory letter drives. I'm looking for a way to map a user's drive in an automated manner without concern of the drive letter.
Understood, Tested, and Verified! Thanks for your patience, as I learn SQL and VBA. I hope to help you two help other users in the future, as I get up to speed.
Okay Remou! For my first piece of code, my problem was with the single quotes around the names 'Martin’, 'Green’. It should be 'Martin', 'Green'. I copied code directly from online tutorial.
For the second piece of code, the problem was with the quotation mark at the end of the sentence...
When I eliminate the first two parameters ('Martin’, 'Green’) it works. I don't quite understand. Sometimes I need a semicolon, but at other times I don't.
Remou (TechnicalUser) 7 Mar 06 10:13
I do not think it likes the semicolon:
DoCmd.RunSQL "CREATE TABLE tblTest ([StaffID] COUNTER...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.