B
Bobby Bosco
I have a table that the users need to update. It is a
perfect candidate for continuous forms BUT the users don't
want to scroll because they cannot see all the data that
way.
I don't know much (okay, almost nothing) about using
recordsets except what I could get out of HELP and that is
not all that helpful to me.
So I built a form with all the fields unbound. When the
form loads, I populate those fields via a recordset. That
works very nicely.
However, when I try to save the changed data stepping
through a recordset I get the following error.
Object Variable or With block variable not set.
Here is the code that I am using.
OnLoad...
Dim rst As Recordset
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordset("mt_tagsets", dbOpenDynaset)
Me!TagCap01 = rst!TagCaption
Me!TagTip01 = rst!TagControlTips
If rst!Used = -1 Then
Me!tog01 = -1
Me.tog01.Caption = "ON"
Me.tog01.ForeColor = 16384
Else
Me!tog01 = 0
Me.tog01.Caption = "OFF"
Me.tog01.ForeColor = 255
End If
rst.MoveNext
....
The EXIT code... (this is where I want to update the
table data from the unbound form data)
Dim rst As Recordset
Dim db As Database
Set rst = db.OpenRecordset("mt_tagsets", dbOpenDynaset)
If rst!TagID = 1 Then
rst!TagCaption = Me.TagCap01
rst!TagControlTips = Me.TagTip01
rst!Used = Me.tog01
End If
rst.MoveNext
....
tia
Bobby
perfect candidate for continuous forms BUT the users don't
want to scroll because they cannot see all the data that
way.
I don't know much (okay, almost nothing) about using
recordsets except what I could get out of HELP and that is
not all that helpful to me.
So I built a form with all the fields unbound. When the
form loads, I populate those fields via a recordset. That
works very nicely.
However, when I try to save the changed data stepping
through a recordset I get the following error.
Object Variable or With block variable not set.
Here is the code that I am using.
OnLoad...
Dim rst As Recordset
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordset("mt_tagsets", dbOpenDynaset)
Me!TagCap01 = rst!TagCaption
Me!TagTip01 = rst!TagControlTips
If rst!Used = -1 Then
Me!tog01 = -1
Me.tog01.Caption = "ON"
Me.tog01.ForeColor = 16384
Else
Me!tog01 = 0
Me.tog01.Caption = "OFF"
Me.tog01.ForeColor = 255
End If
rst.MoveNext
....
The EXIT code... (this is where I want to update the
table data from the unbound form data)
Dim rst As Recordset
Dim db As Database
Set rst = db.OpenRecordset("mt_tagsets", dbOpenDynaset)
If rst!TagID = 1 Then
rst!TagCaption = Me.TagCap01
rst!TagControlTips = Me.TagTip01
rst!Used = Me.tog01
End If
rst.MoveNext
....
tia
Bobby