A few minutes to kill while I wait for some wood glue to set so I wanted to play with this a bit. Probably not the way I'd do it because in a split db, the value gets lost every time a new fe is uploaded. If one is sharing the fe (not a good idea) then this could be very wonky. However, if you put the first block of code in a standard module and edit the click event to the 2nd code block, it works. In fact, it's so fast that it appears noting changes. Test that by trying the same value again and see what happens. Note: you can also write the function call as ChangeDefault Me.Name, frameOptGroup
Code:
Public Function ChangeDefault(frmName As String, lngDefValue As Long)
DoCmd.Close acForm, frmName
DoCmd.OpenForm frmName, acDesign, , , , acHidden
Forms(frmName).frameOptGroup.DefaultValue = lngDefValue
With DoCmd
.Save acForm, frmName
.Close acForm, frmName
.OpenForm frmName
End With
End Function
Private Sub imgSetDefault_Click()
Dim intResult As Integer
Dim strMsg As String
If Me.frameOptGroup.DefaultValue = Me.frameOptGroup Then
MsgBox "Selected value is already the default!"
Exit Sub
End If
strMsg = "Switch default from " & Me.frameOptGroup.DefaultValue & " to " & Me.frameOptGroup & "?"
intResult = MsgBox(strMsg, vbYesNo)
If intResult = 6 Then
Call ChangeDefault(Me.Name, frameOptGroup)
End If
End Sub