Run-time error 3075 - Is there Something Wrong?

Ashfaque

Search Beautiful Girls from your town for night
Local time
Today, 20:41
Joined
Sep 6, 2004
Messages
894
I am trying to overwrite unbound text box data to a temporary tbl with below code but it produces subjected runtime error 3075.

Code:
strSQL = "UPDATE T_ATemp set [ExistingTotSaudis] = '" & Me!OverAllSaudis & "', [ExistingTotExpats]= '" & Me!OverAllExpats & "', [NewSaudiAddition]= '" & Me!TxtNewSaudiPerc & "', [NewExpatAddtion]='" & (Me!NewExpatPerc) & "');"

Out of 4 unbound text boxes 2 of them contains integer value and other 2 has percentage that is calculating from different process. Please see the attached.

Any idea
 

Attachments

  • Error.jpg
    Error.jpg
    16 KB · Views: 330
Usually means you got to many, or to few, parentheses. ..
 
Not sure of your datatypes so I can't comment on your delimiting.

You have 3 parenthesis which are probably not needed.
Code:
(Me!NewExpatPerc) & "');"
 
Datatype is number with 2 decimals.
Code:
Dim strSQL As String
strSQL = ("DELETE * FROM T_ATEMP")
DoCmd.RunSQL strSQL
strSQL = ("UPDATE T_ATemp set [ExistingTotSaudis] = " & Me!OverAllSaudis & ", [ExistingTotExpats]= " & Me!OverAllExpats & ", [NewSaudiAddition]= " & Me!TxtNewSaudiPerc & ", [NewExpatAddtion]=" & NewExpatPerc)
DoCmd.RunSQL strSQL

I just want to delete previous record and update with new one that generated in textboxes.

I tried with above but still same error.:oops:
 
Now no error in below code
Code:
strSQL = "UPDATE T_ATemp set [ExistingTotSaudis] = " & Me!OverAllSaudis & ", [ExistingTotExpats]= " & Me!OverAllExpats & ", [NewSaudiAddition]= " & Me!TxtNewSaudiPerc & ", [NewExpatAddtion]=" & NewExpatPerc

But displays You are about Update (0) rows where as there is new values in unbound text boxes.
 
You can't update a non-existent record.
You need to insert a new one!
 
You didn't include the delete portion of your code in the original post which in this case is an important omission.
It's always best to include the complete code.
 

Users who are viewing this thread

Back
Top Bottom