473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CurrentDb.Execute Problem

MitchR
65 64KB
Hello Folks;

I have run myself into a hole I cannot get of and need some assistance. I have a Form "Frm_ATandT_Activation_Center" that has a sub form "Frm_ATandT_Activation". Frm_ATandT_Activation_Center is standard in Form View with no Master or Child links to the Sub form. this allows me to show available SIM ID"S in inventory for activation. The Subform diplays as a datasheet that has a Query as the control source. So when the user opens the form as a whole they see the listing of available SIM ID"S and 2 textbox controls to enter a remedy ticket number and an Employee ID. I am also Capturing the date and the employee's user name that activates the SIM. I have everything working except the CurrentDb.Execute statement to matchup all the entered data to the SIM that is being activated. here is my after update event of a combo box that the user chooses that corresponds with the SIM number to be activated.
Code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Text1_AfterUpdate()
  2. Dim strSim As String
  3. Dim strRemedy_Num As String
  4. Dim strEID As String
  5. Dim strUser As Variant
  6. Dim varRespond As Variant
  7. Dim strSQL As String
  8. Set Db = CurrentDb
  9. stDocName = "Frm_AtandT_Activation_Center"
  10. varSim = Me.SIM
  11. varUser = fOSUserName
  12. varEID = Forms.Frm_ATandT_Activation_Center.EID
  13. varRemedy = Forms.Frm_ATandT_Activation_Center.Remedy_num
  14. varUser = Forms.Frm_ATandT_Activation_Center.Text18
  15. Date = Forms.Frm_ATandT_Activation_Center.Used
  16.     Respond = MsgBox("Are you Ready to issue this Sim -->" & varSim & " <-- to a Hand Held Device? " & _
  17.                 "Using Remedy Number " & varRemedy & vbCrLf & _
  18.                 " Employee ID Number " & varEID & " ?", vbYesNo, "Ready to Complete Activation? ")
  19. If Respond = vbYes Then
  20.  
  21.       CurrentDb.Execute "UPDATE tbl_SimInventory SET [Used] = " & Date & " , SET [UserNam] = " & varUser & " , 
  22.  Set [Remedy_Num] = " & varRemedy & ", Set [EID] = " & varEID & " WHERE SIM = " & Me.SIM_list
  23.  
  24.  
  25.     DoCmd.Close
  26.     DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal
  27.  
  28.  
  29. If Respond = vbNo Then
  30.        MsgBox "You may complete any changes needed for this activation", , " No Worries! "
  31. Forms.Frm_ATandT_Activation_Center.Used = Null
  32. Forms.Frm_ATandT_Activation_Center.Remedy_num = Null
  33. Forms.Frm_ATandT_Activation_Center.EID = Null
  34. Forms.Frm_ATandT_Activation_Center.UserNam = Null
  35. Me.Text1 = "Inventory"
  36. End If
  37. End If
  38. End Sub
  39.  

My main goal is to fix my CurrentDb.Execute to enter the data to the corresponding SIM ID
Thank you so very much for your help.
Jun 2 '08 #1
1 3034
FishVal
2,653 Expert 2GB
Hi, Mitch.

SQL statement you pass to Execute method contains numerous syntax errors. I suggest you to create it and test in query design to get a working one.

And, just out of curiosity, was that a bad idea to insert records via bound form?

Regards,
Fish
Jun 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John | last post by:
Hi In Access 2000 I have the following code; Set dbs = CurrentDb <some code to access database here> Set dbs = Nothing
8
by: frank | last post by:
Below is some code for doing and insert into one of my tables. The inserts do not work because a duplicate key exists, which I want to happen. The problem is, I cannot get access to return an error...
1
by: teddysnips | last post by:
Scenaria - Access 2000 FE - 2 clients Access 2000 BE - on a network server. Tiny little application, all tried and tested code. Worked fine until this morning, when users began receiving the...
1
by: GSteven | last post by:
I have a statemnt which says: CurrentDb.Execute strSQL, dbFailOnError where strSQL is a create query. Is there an overwrite option for the execute method so thath I don't get the 'file already...
1
by: klatham | last post by:
I have about 3 reports that I have been using for several months very successfully. However, suddenly when I try to run a couple of them, I get a message like: "Enter Parameter Value CurrentDb". ...
7
by: Tony M. | last post by:
I'm trying to execute an append query. I have a case that works, and one that returns an object not set error. THIS WORKS: Private Sub cmdArchiveRecs_Click() BeginTrans CurrentDb.Execute...
3
by: Richard Hollenbeck | last post by:
In DAO, is there any difference between "set db = CurrentDb()" with parentheses and "set db = CurrentDb" without parentheses? I'm just looking for data from a single field in a table inside the...
0
by: Alan Carpenter | last post by:
I'm curious about getting to the text of procedures in a database other than the current database without a new instance of Access. Note I don't want to execute or call anything, I just want to...
1
by: sphinney | last post by:
As my Access form opens, I want it to find the names of the tables in the current Access database and populate a combobox with the table (recordset) names. Problem is, the CurrentDb.Recordsets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.