Data Access Page Command Button

A

Adrian Lodge

Hi,

I have an access page summarized with records from my
table. On the left there is a command button which I want
to be able to open a new page with details of that record.
I have done it as a form and it works perfectly, but how
can I do it on a page?

I also tried converting the form to a page, but none of
the code was transferred.

Please help
 
A

Adrian Lodge

Thanks Mark.

I tried your suggestion and it works fine. What I am
trying to do however, is to have a list of all the records
on one page with brief details. Beside each record I have
a link or command button beside each record which opens a
page with full details that allows data entry. On the full
details page, I also want to have a beforeupdate script or
an onclose script to rearrange some fields before saving.

This is the code from the similar forms I made:
(Main Page)
Private Sub Update_Click()
On Error GoTo Err_Update_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Interruption Full Details"

stLinkCriteria = "[Interruption Number]=" & "'" & Me!
[Interruption Number] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Update_Click:
Exit Sub

Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click

End Sub

(Detail Page)
Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim IDtxt As String
Dim ID2txt As String
Dim ID3txt As String

ID.SetFocus
IDtxt = ID.Text
ID2.SetFocus
ID2txt = ID2.Text
ID3.SetFocus
ID3txt = Mid(ID3.Text, 3)

Interruption_Number = IDtxt & ID2txt & ID3txt
Closed_Date.SetFocus
If Closed_Date.Text = "" Then
Status = "Open"
Else: Status = "Closed"
End If

End Sub

Thanks alot,
If you know how to do this, please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top