My Assistant
![]() ![]() |
|
|
Nov 21 2004, 05:11 PM
Post
#1
|
|
|
New Member Posts: 17 From: NYC |
The code below works perfectly in Access 97 but when I run it in Access 2002 I get a run time error telling me Access can't find the control when I'm trying to assign the variable v3 [v3 = Me("ListQID" & i).Value] and v4 [v4 = Me("Combo" & i).Value]. I've posted in Access Modules not getting a lot of view there. Any help would be greatly appreciated. Oh, I've already checked the library reference which I though was problem but that did not do the trick (IMG:http://www.utteraccess.com/forum/style_emoticons/default/shrug.gif)
Thanks Gregg Private Sub Command534_Click() Dim v1 As String 'RID Dim v3 As String 'QuestionID Dim v4 As String 'Response Dim i As Integer 'Counter Dim j As Integer 'Counter Application.SetOption "Confirm Action Queries", False On Error GoTo ErrorHandler If IsNull(Me.RID) = True Then RID.SetFocus: Exit Sub v1 = [RID] For i = 2 To 75 v3 = Me("ListQID" & i).Value v4 = Me("Combo" & i).Value If i < 9 Then DoCmd.RunSQL ("Insert into tbl_intrv_info (RID,qid,response)" & _ "Select '" & v1 & "', '" & v3 & "', '" & v4 & "';") Else: DoCmd.RunSQL ("Insert into tbl_responses (RID,qid,response)" & _ "Select '" & v1 & "', '" & v3 & "', '" & v4 & "';") End If Me("Combo" & i).Value = Null 10: Next i For j = 63 To 65 Step 1 If Me("Check" & j).Value = True Then v3 = "Dissem06" v4 = Me("Check" & j).Tag DoCmd.RunSQL ("Insert into tbl_responses (rid,qid,response)" & _ "Select '" & v1 & "', '" & v3 & "', '" & v4 & "';") Me("Check" & j).Value = False End If Next j [RID] = Null Application.SetOption "Confirm Action Queries", True RID.SetFocus DoCmd.RunCommand acCmdDataEntry Exit Sub ErrorHandler: Resume 10: End Sub |
|
|
|
Nov 22 2004, 09:22 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 1,097 From: Zagreb - Croatia |
Hello redux8!
Try this v3 = Me.ListQID & i v4 = Me.Combo & i |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 05:13 AM |