| View previous topic :: View next topic |
| Author |
Message |
SKP Newbie
Joined: 23 Dec 2003 Posts: 7
|
Posted: Dec 23rd, 2003 10:32 AM Post subject: linking fields in a pop up form (access2000) |
|
|
I'm trying to set up a way that will allow me to enter a name and click a button to show a popup form of detailed information for an individual. I was hoping someone could help me figure out what I am doing wrong because I keep getting a syntax error when I click on my command button. I'm new to visual basic and trying to learn as I go, so any help will be greatly appreciated. I've attached a copy of the code where I'm having trouble.
Sub FormPic1_Click()
On Error GoTo Err_FormPic1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Studio Director Detail Form"
stLinkCriteria = "[StudioDirectorName] = " & Me![StudioDirectorName]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_FormPic1_Click:
Exit Sub
Err_FormPic1_Click:
MsgBox Err.Description
Resume Exit_FormPic1_Click
End Sub |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Dec 23rd, 2003 01:24 PM Post subject: |
|
|
Is the link criteria in the "Filter" variable location? I don't have a version of access available right now, will have to check when I get to one. If it is...try this:
stLinkCriteria = "StudioDirectorName=" & StudioDirectorName
PS: make sure the Form your loading doesnt have anything in the OnFormOpen that clears the filter...I think it's DoCmd.acClearFilter or something like that.
Edit: Can we move this to the VBA section? Since it does deal with that. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Last edited by Andir on Dec 23rd, 2003 02:08 PM; edited 1 time in total |
|
| Back to top |
|
|