mtagliaferri
Registered User.
- Local time
- Today, 13:35
- Joined
- Jul 16, 2006
- Messages
- 550
If the form is displayed as "Form View" then it can have an event procedure run when it is Clicked/DoubleClicked but I don't understand what you meant by:When a form property has "Record Selectors" set to yes is there a way to use this to click/double click to create an event as a detailed form?
....create an event as a detailed form
Not sure what you mean by this.... but not code on the record selector itself AFAIK
Private Sub TimelineDate_DblClick(Cancel As Integer)
On Error GoTo TimelineDate_DblClick_Err
DoCmd.OpenForm "frmUpdatesTimeline", acNormal, "", "[IDUpdatesTimeline]=" & IDUpdatesTimeline, acEdit, acDialog
TimelineDate_DblClick_Exit:
Exit Sub
TimelineDate_DblClick_Err:
MsgBox Error$
Resume TimelineDate_DblClick_Exit
End Sub
IDUpdatesTimeline, , acDialog
DoCmd.OpenForm "frmUpdatesTimeline", acNormal, [COLOR="Red"]""[/COLOR], "[IDUpdatesTimeline]=" & IDUpdatesTimeline, [COLOR="red"]acEdit[/COLOR], acDialog
DoCmd.OpenForm "frmUpdatesTimeline", acNormal, , "[IDUpdatesTimeline]=" & IDUpdatesTimeline, acFormReadOnly, acDialog
On Error GoTo CmdSave_Click_Err
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "frmUpdatesTimeline"
CmdSave_Click_Exit:
Exit Sub
CmdSave_Click_Err:
MsgBox Error$
Resume CmdSave_Click_Exit
Thanks Colin,
that solved the issue, but with one thing solved it triggers something else...
I have two cmd buttons on the form opened in Read only, one is a save comd and one an edit, if I edit the form and the save it all works fine, but if I don't make any changes and press the save I get an error "The command or action 'SaveRecord' is not available now".
I would like to keep the form neat and have only one cmd button that does the save and close function too so thatI don't confuse the user or risk changes to the form that is then been closed and not saved, hope this makes sense!
Private Sub cmdClose_Click()
On Error GoTo CmdClose_Click_Err
'save any changes if in edit mode
If Me.Dirty Then Me.Dirty=False
DoCmd.Close acForm, Me.Name
CmdClose_Click_Exit:
Exit Sub
CmdClose_Click_Err:
MsgBox "Error " & err.Number & " : " & Err.Description
Resume CmdClose_Click_Exit
End Sub
Private Sub cmdClose_Click()
On Error GoTo CmdClose_Click_Err
'save any changes if in edit mode
If Me.Locked=False Then DoCmd.Save
DoCmd.Close acForm, Me.Name
CmdClose_Click_Exit:
Exit Sub
CmdClose_Click_Err:
MsgBox "Error " & err.Number & " : " & Err.Description
Resume CmdClose_Click_Exit
End Sub