Hello guys, I would like to ask how do I enable my vba code to read and retrieve data from my table so that i will be able to calculate the grossweight by clicking onto "Calculate Grossweight" button on my form?
I tried using SQL method, and it prompt me error 3078 which say that "the Microsoft Access database engine cannot find the input table or query 'Calculate mxd SET LBS =100, Content = '100%Cotton', Reference = 'Bio', GrossWeight = ",Nettweight = '43.35'. Make sure it exists and that its name is spelled correctly. "
Below is my code:
CurrentDb.Execute "Calculate mxd" & _
" SET LBS = " & Me.txtLbs & _
", Content = '" & Me.txtContent & "'" & _
", Reference = '" & Me.txtReference & "'" & _
", GrossWeight = '" & Me.txtGrossweight & "'" & _
", NettWeight = '" & Me.txtNettweight & "'"
If Lbs <= 130 And Content = "100%Content" And Reference Like "Bio" Then
GrossWeight = (NettWeight * (102 / 100)) + 20
End If
I get that error msg on the code that i bold.
How do I fix that? Thank you.
I tried using SQL method, and it prompt me error 3078 which say that "the Microsoft Access database engine cannot find the input table or query 'Calculate mxd SET LBS =100, Content = '100%Cotton', Reference = 'Bio', GrossWeight = ",Nettweight = '43.35'. Make sure it exists and that its name is spelled correctly. "
Below is my code:
CurrentDb.Execute "Calculate mxd" & _
" SET LBS = " & Me.txtLbs & _
", Content = '" & Me.txtContent & "'" & _
", Reference = '" & Me.txtReference & "'" & _
", GrossWeight = '" & Me.txtGrossweight & "'" & _
", NettWeight = '" & Me.txtNettweight & "'"
If Lbs <= 130 And Content = "100%Content" And Reference Like "Bio" Then
GrossWeight = (NettWeight * (102 / 100)) + 20
End If
I get that error msg on the code that i bold.
How do I fix that? Thank you.