Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting

Post new topic   Reply to topic
linking fields in a pop up form (access2000)
View previous topic :: View next topic  
Author Message
SKP
Newbie


Joined: 23 Dec 2003
Posts: 7

PostPosted: Dec 23rd, 2003 10:32 AM    Post subject: linking fields in a pop up form (access2000) Reply with quote

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
View user's profile Send private message
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Dec 23rd, 2003 01:24 PM    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic