473,387 Members | 1,492 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,387 software developers and data experts.

MS Access script not working. Please help with script.

Please help with this code. I am unable to figure out what's wrong with it.

The purpose of this code is to copy data from one record into an infinite amount of records. For example if there were 5 department records (from different departments) linked by a common identifier (worksheet#). The (worksheet#) and I wanted to enter information in one record and have that data copied into the remaining 4.

Thanks in Advance for your help!

Regards,

DR

Here is code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CmdCopyPaste_Click()
  2.  
  3. Dim iResponce As Integer
  4.  
  5. iResponce = MsgBox("Are you sure you want to copy THESE results to ALL departments on THIS worksheet? ", vbYesNo, "COPY Results")
  6.  
  7. If iResponce = vbYes Then ' They Clicked YES
  8.  
  9.  
  10.  
  11. Dim vInterviewee
  12.  
  13. Dim vInterviewDate As String
  14.  
  15. Dim vExpWContent
  16.  
  17. Dim vExpWSystems
  18.  
  19. Dim vMaxOffFloor
  20.  
  21. Dim vImpactedProjects
  22.  
  23. Dim vLocation
  24.  
  25. Dim vGoodTimes
  26.  
  27. Dim vBadTimes
  28.  
  29. Dim vAccessibilityIssues
  30.  
  31. Dim vAccessibilityDesc
  32.  
  33. Dim vConcurrentTraining
  34.  
  35. Dim vConTrainDetail
  36.  
  37. Dim vSpecialNeeds
  38.  
  39. Dim vSpecNeedDetail
  40.  
  41. Dim vProcessChange
  42.  
  43. Dim vBusProcessContact
  44.  
  45. Dim vProcessEPOContact
  46.  
  47. Dim vProcessDetail
  48.  
  49. Dim vNotes
  50.  
  51. Dim vID
  52.  
  53.  
  54.  
  55. Dim strSQL
  56.  
  57.  
  58.  
  59. Me.Dirty = False ' save current record
  60.  
  61.  
  62.  
  63. vInterviewee = Me.Interviewee
  64.  
  65. vProjectImpact = Me.ProjectImpact
  66.  
  67. vExpWContent = Me.ExpWContent
  68.  
  69. vExpWSystems = Me.ExpWSystems
  70.  
  71. vMaxOffFloor = Me.MaxOffFloor
  72.  
  73. vImpactedProjects = Me.ImpactedProjects
  74.  
  75. vLocation = Me.Location
  76.  
  77. vGoodTimes = Me.GoodTimes
  78.  
  79. vBadTimes = Me.BadTimes
  80.  
  81. vAccessibilityIssues = Me.AccessibilityIssues
  82.  
  83. vAccessibilityDesc = Me.AccessibilityDesc
  84.  
  85. vConcurrentTraining = Me.ConcurrentTraining
  86.  
  87. vConTrainDetail = Me.ConTrainDetail
  88.  
  89. vSpecialNeeds = Me.SpecialNeeds
  90.  
  91. vSpecNeedDetail = Me.SpecNeedDetail
  92.  
  93. vProcessChange = Me.ProcessChange
  94.  
  95. vBusProcessContact = Me.BusProcessContact
  96.  
  97. vProcessEPOContact = Me.ProcessEPOContact
  98.  
  99. vProcessDetail = Me.ProcessDetail
  100.  
  101. vNotes = Me.Notes
  102.  
  103. vID = Me.ID
  104.  
  105.  
  106.    If IsNull(InterviewDate) Then
  107.  
  108.       vInterviewDate = "NULL"
  109.  
  110.    Else
  111.  
  112.       vInterviewDate = "#" & CStr(InterviewDate) & "#"
  113.  
  114.    End If
  115.  
  116. strSQL = "Update tblAAResults set Interviewee =  '" & vInterviewee & _
  117.  
  118. "', InterviewDate = " & vInterviewDate & " " & " ,  ProjectImpact = '" & vProjectImpact & "' , ExpWContent = '" & vExpWContent & _
  119.  
  120. "' , ExpWSystems = '" & ExpWSystems & "', MaxOffFloor = '" & vMaxOffFloor & _
  121.  
  122. "', ImpactedProjects = '" & vImpactedProjects & "', Location = '" & vLocation & _
  123.  
  124. "', GoodTimes = '" & vGoodTimes & "', BadTimes = '" & vBadTimes & _
  125.  
  126. "' , AccessibilityIssues = '" & vAccessibilityIssues & "' , AccessibilityDesc = '" & vAccessibilityDesc & _
  127.  
  128. "' , ConcurrentTraining = '" & vConcurrentTraining & "', ConTrainDetail = '" & vConTrainDetail & _
  129.  
  130. "', SpecialNeeds = '" & vSpecialNeeds & "', SpecNeedDetail = '" & vSpecNeedDetail & _
  131.  
  132. "' , ProcessChange = '" & vProcessChange & "', BusProcessContact = '" & vBusProcessContact & _
  133.  
  134. "', ProcessEPOContact = '" & vProcessEPOContact & " ', ProcessDetail = '" & vProcessDetail & _
  135.  
  136. "', ID = '" & vID & "',  Notes = '" & vNotes & "' where AAID = " & Me.AAID & " and Department <> ' " & Me.Department & "'"
  137. MsgBox strSQL
  138. Debug.Print strSQL
  139. CurrentDb.Execute strSQL, dbFailOnError
  140.  
  141. Else
  142.  End If
  143. End Sub
Sep 12 '07 #1
2 1529
damonreid
114 Expert 100+
Why not just link the tables using a query if they have the same common key? That way you can keep the information in one location and still use it for reporting.
Sep 12 '07 #2
NeoPa
32,556 Expert Mod 16PB
Daniell,

This is too much like a "Please do my job for me" request.
That is not what this forum is about. We answer technical questions when we can and may guide and assist in some small measure while we do so. We are not a free resource to do your job for you.

If you want help on this then you must form this into some sort of question after doing as much as you can to determine your problem for yourself. You would also need to pass on (explain) what you understood of the problem.

MODERATOR.
Sep 12 '07 #3

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

Similar topics

2
by: Nasir Wasim | last post by:
How can Access DIV Properties in Script while using Netscape 7.2. I want to use the div id with it's Visibility and left propertyin script but it's not working :-( Main File : ----------- ...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
4
by: Martin | last post by:
Hi, I am getting an "Access Denied" error when attempting to browse asp.net pages. I have installed ASP.NET 1.1.4322 on a domain controller. The machine also has ASP.NET 1.0.3705 installed on...
1
by: Charles Wilson | last post by:
Can someone point me to some good instructions on using the WinInet.dll functions from VBA? I need to interact with a MySQL database via HTTP strings. We already have the database set up and a...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
1
by: ravindrakale007 | last post by:
Hello everyone i have a problem with my db connection i paste code below please check anyone where i am wrong its very urgent please any one help me!!!!! and i am working offline using local iis...
2
by: bandkindy | last post by:
To preface, I am pretty green on the whole sql thing, but am learning quickly so please bear with me. I have an excel file that is copied to 5 users directories so they have their own working...
1
by: bandkindy | last post by:
To preface, I am pretty green on the whole sql thing, but am learning quickly so please bear with me. I have an excel file that is copied to 5 users directories so they have their own working...
25
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.