I am hoping someone can help me as I've done this sort of thing before with no problems. I am using Access 2003 SP2 on WinXP prof SP2
I have an unbound form (single form view) with 18 unbound text controls and a command button. I am trying to have this code on 'On Click' Event of the button to insert the data into a table (which has an autonumber PK)
- Dim sSQL As String
-
sSQL = " INSERT INTO tbl_ScribalMain " & _
-
"(CompName, ContactName, [Position], DelAddress1, DelAddress2, DelTown, DelPCode, Country, Phone, Fax, Mobile, Email, [Website], BusinessType, [Group], ABN, Notes, [ReSubCalls-Comments])" & _
-
"VALUES('" & Me.txtCompName & "', '" & Me.txtContactName & "', '" & Me.txtPosition & "', '" & Me.txtAddress1 & "', " & _
-
"'" & Me.txtAddress2 & "', '" & Me.txtTown & "', '" & Me.txtPCode & "', " & _
-
"'" & Me.txtCountry & "', '" & Me.txtPhone & "', '" & Me.txtFax & "', '" & Me.txtMobile & "', '" & Me.txtEmail & "', " & _
-
"'" & Me.txtWebsite & "', '" & Me.txtBusType & "', '" & Me.txtGroup & "', '" & Me.txtABN & "', " & _
-
"'" & Me.txtBusNotes & "', '" & Me.txtComments & "');"
-
-
DoCmd.RunSQL sSQL
I am receiving a 'method or data member not found' error when I try to compile or run the code. The highlighted member is Me.txtWebsite
It is spelled correctly
I initially tried it without the "Dim sSQL As String", just going "DoCmd.RunSQL etc, but it didn't make any difference.
The thing that kills me is that this is my second attempt.
On my first attempt I used a form that was bound to the Table and the text controls were bound to their respective fields in the table. I removed the 'Control Source' from all fields and the form, making it unbound and had the same problem but with Me.txtPosition which is third VALUE parameter in code.
To make sure there wasnt something strange coming across with old form I started from scratch with a brand new, unbound form and created and named all the fields, and now the error is on Me.txtWebsite which is the tenth VALUE parameter in the code.
I have check all the spellings over and over. I have made sure that the code is in the same order that the fields appear on the table.
Any help at all with this would be greatly appreciated as I am running out of hair to pull out.
Thanks in advance.