I have a form (with several controls: checkboxes, option buttons...), that displays only (1) record, and gets it's data from a table [tbe...] that also has only (1) record
on that same form is an option button frame that lets the user select (1) of several records in a second table [tbl...] (This second table provides a various "default" combinations for the the values on the form; so that when the user changes the preset opt, the form reflects those new "default" values.)
The record in the first table [tbe...], which is the data source for the form, is then replaced with a record that reflects the user's choice from the 2nd [tbl...]
...all of this works fine, but what I can't get to work, is an action that updates the controls on the form
I also tried moving the me.Refresh from the beforeUpdate to afterUpdate
it's closer to being right, but the form only updates to null values -as if the added record hadn't arrived yet... (timing?)
many thanks in advance,
mark
here's the code:
---------------------------------------
Private Sub frmPresetOption_beforeUpdate(Cancel As Integer)
Dim sSQL As String
DoCmd.SetWarnings False
sSQL = "Delete * from [tbeFixtureSchedulePrintOptions];"
DoCmd.RunSQL sSQL
sSQL = "INSERT INTO tbeFixtureSchedulePrintOptions" _
& " SELECT *" _
& " from tblFixtureSchedulePrintOptions" _
& " WHERE [PresetOption] = " & Me.frmPresetOption & ";"
DoCmd.RunSQL sSQL
Me.Refresh
DoCmd.SetWarnings True
...
-----------
also:
Private Sub frmPresetOption_afterUpdate(Cancel As Integer)
me.refresh
...