benkingery
Registered User.
- Local time
- Today, 03:21
- Joined
- Jul 15, 2008
- Messages
- 153
I have a recordset I want to update with some values derived from control on a form.
here is what I have so far:
I think I am generating the RS correctly, but I don't know how to update it. I want to update it with the values found on the form this will be coded on. The control is called "CountGroup".
You'll also notice that within the SQL statement that my RS is based on there is a SELECT TOP..... statement. Can I insert the variable as I've done here where the variable comes from the control "Number" on my form?
Any help would be much appreciated.
here is what I have so far:
Code:
Private Sub CountGroup_AfterUpdate()
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim myRecordSet As New ADODB.Recordset
myRecordSet.ActiveConnection = cnn1
Dim mySql As String
mySql = "SELECT TOP " & Me.Number & " SafetyCount.Warehouse_Location, SafetyCount.Master_Child, SafetyCount.CountGroup FROM SafetyCount ORDER BY SafetyCount.Warehouse_Location, SafetyCount.Master_Child"
I think I am generating the RS correctly, but I don't know how to update it. I want to update it with the values found on the form this will be coded on. The control is called "CountGroup".
You'll also notice that within the SQL statement that my RS is based on there is a SELECT TOP..... statement. Can I insert the variable as I've done here where the variable comes from the control "Number" on my form?
Any help would be much appreciated.