T
Tommy
Hi,
I have a question about this "Command Button on a Datasheet Form". I found
a summary about implementing it, but I can't do it and can't contact the
author. here is the steps, I don't know how to do or can't do the step 3,
can someone help please. thanks.
A simple technique for placing a psuedo-command button on a Datasheet:
1. Create a query for the form's RecordSource
2. Add a calculated column/field to the query, for example:
Edit: IIf([Status]<>"Closed","Edit","")
3. Drag the field on to the form as a TextBox
4. Set the TextBox's Is Hyperlink property to Yes
5. Add a procedure to the TextBox's OnClick Event, for example:
Private Sub Edit_Click()
With CodeContextObject
DoCmd.RunCommand acCmdSaveRecord
If (Not IsNull(.IssueID) And .Status <> "Closed") Then
DoCmd.OpenForm "EditIssues", acNormal, "", "[IssueID]=" & .IssueID, , acNormal
End If
End With
End Sub
I have a question about this "Command Button on a Datasheet Form". I found
a summary about implementing it, but I can't do it and can't contact the
author. here is the steps, I don't know how to do or can't do the step 3,
can someone help please. thanks.
A simple technique for placing a psuedo-command button on a Datasheet:
1. Create a query for the form's RecordSource
2. Add a calculated column/field to the query, for example:
Edit: IIf([Status]<>"Closed","Edit","")
3. Drag the field on to the form as a TextBox
4. Set the TextBox's Is Hyperlink property to Yes
5. Add a procedure to the TextBox's OnClick Event, for example:
Private Sub Edit_Click()
With CodeContextObject
DoCmd.RunCommand acCmdSaveRecord
If (Not IsNull(.IssueID) And .Status <> "Closed") Then
DoCmd.OpenForm "EditIssues", acNormal, "", "[IssueID]=" & .IssueID, , acNormal
End If
End With
End Sub