run time error 3078

hfs

Registered User.
Local time
Today, 01:29
Joined
Aug 7, 2013
Messages
47
can anybody see the problem with this code!??@
Run time error '3078'

The microsoft access database engine cannot find the input table or query 'false'.Make sure it exists and that its name is spelled correctly.

Code:
Set db = CurrentDb()
        Set ctl = Forms!frmVerifiedBy.Form!LotVerified
          
            If ctl = True Then
SQL = "update tblExcelLocation set LotVerifiedDate = Now, LotVerifiedBy = '" & Replace(str3, " '", "''") & "',' " & Comments = Replace(str4, "'", "''") & "'  WHERE LotVerified = true  And   ID = '" & Replace(str5, " '", "''") & "'"
             

 [COLOR="Red"]  CurrentDb.Execute SQL[/COLOR]
        
              
           Else

            
            MsgBox "Please select the checkbox "


         End If
 

Attachments

  • Capture.JPG
    Capture.JPG
    12.3 KB · Views: 191
One of you guys needs to go to lunch, you're running over each other in your eagerness to help... :p
 
Plenty;)

where is the code located? in the frmVerifiedBy form?

is LotVerified in a subform?

Is ID a text or a number?

where do str3,4 & 5 come from?
 
One of you guys needs to go to lunch, you're running over each other in your eagerness to help... :p

LOL! It's probably pretty close to pub time in the UK. Only 9:30am here, so too early for lunch for me.
 
One of you guys needs to go to lunch, you're running over each other in your eagerness to help... :p
It's so cool that we also provide the similar link and suggestion.. Ha Ha. I am off in 20 mins.. :D
 
thanks alot for ur guys help. i mean this is so cool when ever my mind is not working i just post a thread and go for a tea break :) ,problem get solved before i come back !!

Thanks alot and i always forget to write the debug.print line .....that worked :)
 
Just adding Debug.Print solved? WoW ! ;)

What was the problem if you don't mind me asking and how did you solve it?
 
OH actually,the problem was in my syntax


SQL = "update tblExcelLocation set LotVerifiedDate = Now, LotVerifiedBy = '" & Replace(str3, " '", "''") & "',' " & Comments = Replace(str4, "'", "''") & "' WHERE LotVerified = true And ID = '" & Replace(str5, " '", "''") & "'"


i had to add '" & after comments = ....
and remove the '" before comments !

and this was giving me the database error ,instead of giving me syntax error !

Thanks to u guys for showing me the right direction! :)
 
new statment and its working :)

SQL = "update tblExcelLocation set LotVerifiedDate = Now, LotVerifiedBy = '" & Replace(str3, " '", "''") & "', Comments ='" & Replace(str4, "'", "''") & "' WHERE LotVerified = true And ID = '" & Replace(str5, " '", "''") & "'"
 

Users who are viewing this thread

Back
Top Bottom