Method or Data Member not found

Purdue15

Registered User.
Local time
Today, 10:02
Joined
Jun 12, 2013
Messages
29
Private Sub cmdNewAdd_Click()
'add data to table
Dim strSQL As String

strSQL = "INSERT INTO Correct_Add(SKU, Warehouse,Weight,ULength,UWidth,UHeight,CLength,CWidth,CHeight," & _
" WPT,GC2,GC3,PLAT,PFactor,SAFlag,CType,ABC,ShipType,CFlag,PPType, OptmLS, OptmLSU, ORMD, SFlag, FFlag)" & _
"VALUES('" & Me.ccrtSKU & "','" & Me.ccrtWarehouse & "','" & Me.ccrtWeight & "','" & _
Me.ccrtULength & "','" & Me.ccrtUWidth & "','" & Me.ccrtUHeight & "', '" & Me.ccrtCLength & "','" & Me.ccrtCWidth & _
"','" & Me.ccrtCHeight & "','" & Me.ccrtWPT & "','" & Me.ccrtGPC2 & "','" & Me.ccrtGPC3 & "','" & Me.ccrtPLAT & "','" & _
Me.ccrtPFactor & "','" & Me.ccrtSA & "','" & Me.ccrtCtype & "','" & Me.ccrtABC & "','" & Me.ccrtSType & "','" & _
Me.ccrtCFlag & "''" & Me.ccrtPPType & "','" & Me.ccrtOptmLS & "','" & Me.ccrtOptmLSU & "','" & Me.ccrtORMD & "','" & _
Me.ccrtSF & "','" & Me.FFlag & "')"

CurrentDb.Execute strSQL


End Sub

I also tried debug.Print strSQL and hit ctrl + G to see the immediate box and I cant see anything
 
Insert a DEBUG.Print strSQL

right before the CurrentDb.Execute strSQL

and change to CurrentDb.Execute strSQL,dbFailOnError
which says to give me a message if there is an error.

The debug.print will show you the rendered SQL.

Why did you think you'll see something in the immediate window?
 
Method or Data Member not found will be a compile error so code won't run. What's happening is that you are referencing a member of an object, but the object doesn't expose that member. Probably one of your control references, like "Me.ccrtOptmLS" references a control that doesn't exist.

hth
 
Does the bit in red actually look like this in your code, which is to say is that space there, between CW and idth?

CLength,CW idth,CHeight

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom