Freakinchair
New member
- Local time
- Today, 15:33
- Joined
- Aug 7, 2007
- Messages
- 8
Alright,
Problem #1 -
Im attempting to append two values into a table when a button is pressed. There are two cases for this, for my first case it works fine. The second case involves choosing a pre-existing record to append into a reference table. Here is the code:
DoCmd.RunSQL "INSERT INTO XREF_FILE_INSPECTOR " _
& "(FILE_NUMBER_CD, INSPECTOR_NUMBER_CD) VALUES " _
& "([Forms]![GeneralFile].[txtGeneralFileNumber], cmdInspector.Column(0) )"
The problem is that "cmdInspector.Column(0)" isnt actually getting that value and I get a runtime error that declares it is not a function. How do I get the proper value?
Problem #2 -
I've also create a button to remove a selected record from a list. In order to do this I just created a "Delete Query" so that when a button was clicked the query would delete the selected record from the correct table. Here is the code:
DoCmd.OpenQuery ("QryRemInspector")
I run the button and it asks whether I want to delete the selected record (I click yes) and then I get an error:
Error 3125: QryRemInspector is not a valid name. (stuff about too long, punctation etc...) I know this name is valid and it is the name of the query I need to use. What could be going on?
Also - I am using Access 2000 if that makes any difference.
Thanks for any help guys!
Problem #1 -
Im attempting to append two values into a table when a button is pressed. There are two cases for this, for my first case it works fine. The second case involves choosing a pre-existing record to append into a reference table. Here is the code:
DoCmd.RunSQL "INSERT INTO XREF_FILE_INSPECTOR " _
& "(FILE_NUMBER_CD, INSPECTOR_NUMBER_CD) VALUES " _
& "([Forms]![GeneralFile].[txtGeneralFileNumber], cmdInspector.Column(0) )"
The problem is that "cmdInspector.Column(0)" isnt actually getting that value and I get a runtime error that declares it is not a function. How do I get the proper value?
Problem #2 -
I've also create a button to remove a selected record from a list. In order to do this I just created a "Delete Query" so that when a button was clicked the query would delete the selected record from the correct table. Here is the code:
DoCmd.OpenQuery ("QryRemInspector")
I run the button and it asks whether I want to delete the selected record (I click yes) and then I get an error:
Error 3125: QryRemInspector is not a valid name. (stuff about too long, punctation etc...) I know this name is valid and it is the name of the query I need to use. What could be going on?
Also - I am using Access 2000 if that makes any difference.
Thanks for any help guys!