M
misschanda via AccessMonster.com
have a form, where if needed a change button is pushed and a new form opens
listing all the records. The list box allows the user to scroll and select
the record in which he/she wants to revise. upon selection the chosen record
should open and changes can be made, And than it is added into the main list
of records.
I am getting the following error:
Set rs1 = db1.OpenRecordset(QueryTxt, dbOpenDynaset)
The VB code I am using starts off as following:
Private Sub Command4_Click()
Dim QueryTxt, QueryParm, TrialNum, LineNum As String
Dim RevNum, RevNumGrid, RevNumToRetreive As Integer
Dim rs1 As Recordset
Dim db1 As Database
Set db1 = CurrentDb
TrialNum = List10.Column(3, List10.ListIndex + 1)
RevNumGrid = List10.Column(5, List10.ListIndex + 1)
'The selected Option Button value is stored in the frame... How dumb is
that?
Select Case Frame8
Case 1
'Create a new version of the selected Guideline...
'First retrieve the highest revision number...
If List10.Column(3, List10.ListIndex + 1) = "Trial_Number" Then
MsgBox "You must select a Lab Line record to copy to a new
revision."
Exit Sub
End If
QueryTxt = "SELECT Max([Revision]) AS Expr1 FROM
[Lab_LIne_Processing_Record2] WHERE [Lab_LIne_Processing-Record2].
Trial_Number='" + List10.Column(3, List10.ListIndex + 1) + "' AND
[Lab_LIne_Processing_Record2].Project_Number='" + List10.Column(4, List10.
ListIndex + 1) + "';"
Set rs1 = db1.OpenRecordset(QueryTxt, dbOpenDynaset)
RevNum = rs1!Expr1 + 1
listing all the records. The list box allows the user to scroll and select
the record in which he/she wants to revise. upon selection the chosen record
should open and changes can be made, And than it is added into the main list
of records.
I am getting the following error:
Set rs1 = db1.OpenRecordset(QueryTxt, dbOpenDynaset)
The VB code I am using starts off as following:
Private Sub Command4_Click()
Dim QueryTxt, QueryParm, TrialNum, LineNum As String
Dim RevNum, RevNumGrid, RevNumToRetreive As Integer
Dim rs1 As Recordset
Dim db1 As Database
Set db1 = CurrentDb
TrialNum = List10.Column(3, List10.ListIndex + 1)
RevNumGrid = List10.Column(5, List10.ListIndex + 1)
'The selected Option Button value is stored in the frame... How dumb is
that?
Select Case Frame8
Case 1
'Create a new version of the selected Guideline...
'First retrieve the highest revision number...
If List10.Column(3, List10.ListIndex + 1) = "Trial_Number" Then
MsgBox "You must select a Lab Line record to copy to a new
revision."
Exit Sub
End If
QueryTxt = "SELECT Max([Revision]) AS Expr1 FROM
[Lab_LIne_Processing_Record2] WHERE [Lab_LIne_Processing-Record2].
Trial_Number='" + List10.Column(3, List10.ListIndex + 1) + "' AND
[Lab_LIne_Processing_Record2].Project_Number='" + List10.Column(4, List10.
ListIndex + 1) + "';"
Set rs1 = db1.OpenRecordset(QueryTxt, dbOpenDynaset)
RevNum = rs1!Expr1 + 1