button question

J

jackrobyn1

I have a basic continuous form that a user can enter basic info about an
accident eg Reference number, employee name, vehicle number etc etc. next to
each record there is a button that takes me to a larger form conected to the
same table, this is so a manager can add a more complete picture of the
accidents events, i want this button to ask for a password before opening the
form. how can i do this? the buttons on click code is as follows:

Private Sub Command154_Click()
On Error GoTo Err_Command154_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "IncidentsEntryFRM"

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

Exit_Command154_Click:
Exit Sub

Err_Command154_Click:
MsgBox Err.Description
Resume Exit_Command154_Click

End Sub

Can you just add the code required to ask for a password please

Thanks
 
J

jackrobyn1

I have looked at this but it would be better for me to have a button version
as i said.

Pete D. said:
Look at Password Protecting A Microsoft Access Tab Control
http://www.databasedev.co.uk/tab-control.html

jackrobyn1 said:
I have a basic continuous form that a user can enter basic info about an
accident eg Reference number, employee name, vehicle number etc etc. next
to
each record there is a button that takes me to a larger form conected to
the
same table, this is so a manager can add a more complete picture of the
accidents events, i want this button to ask for a password before opening
the
form. how can i do this? the buttons on click code is as follows:

Private Sub Command154_Click()
On Error GoTo Err_Command154_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "IncidentsEntryFRM"

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

Exit_Command154_Click:
Exit Sub

Err_Command154_Click:
MsgBox Err.Description
Resume Exit_Command154_Click

End Sub

Can you just add the code required to ask for a password please

Thanks
 

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