Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open form with Hyperlink

Status
Not open for further replies.

mmckeel

Technical User
Jul 11, 2001
7
US
I am making a maintenance-tracking database. On my switchboard form I have a sub form (form! Open calls2) in datasheet view that shows a summary of open calls. One of my fields is the maintenance ID auto generated by access. I want to make the maintenance ID field a hyperlink that opens the form Maintenance2, which shows the details of the call and allows edits. I have tried the docmd.openform in the On_Click event but can’t seem to get the WHERE clause right because there are multiple Maintenance ID’s on the form. The form opens but is blank. Help
thanks
 
is this a TEXT or Number field type

Dim MaintID As Variant
MaintID = "maintenance ID = " & Me![maintenance ID] ' this is for number
MaintID = "maintenance ID = '" & Me![maintenance ID] & "'" 'this is if it is a Text type
DoCmd.OpenForm "calls2", acNormal, , MaintID

DougP, MCP
 
When I run this I get an "Enter Parameter Value" form that pops up asking for the MaintID and when I enter it into the pop-up form for example 247 the form opens but shows every record not the specific one that corresponds to MaintID =247.

This is the code I have:

Private Sub Maintenance_ID_Click()
Dim MaintID As Variant
MaintID = "Maintenance ID = " & Me![Maintenance ID] ' this is for number

DoCmd.OpenForm "Duke maintenance3", acNormal, , "MaintID"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top