PC Review


Reply
Thread Tools Rate Thread

Custom Parameter Query - Help, please?

 
 
New Member
Join Date: Jun 2011
Posts: 2
 
      12th Jun 2011
Hello,
I'm pretty novice so I hope you'll see something quick and easy and not laugh at my attempts.

I'm creating a Switchboard/Navigation Page (not sure if I plan to use the MS Switchboard or not...it wasn't an option last time I needed to fiddle w/Access). Anyway, I feel like I'm 90% of the way there, but keep failing.

I have a form (currently named: ztestNavButton) dressed up like a parameter query input box. It contains one text box (unbound; named: txtInputPN1) and one button (default name: Command4). The user is intended to enter the Project Number in the text box, press the button and it will open a form to the record specified by the Project Number so that new records can be entered into the associated subform.

Here's the associated code:

Private Sub Command4_Click()
DoCmd.OpenForm "frmProjectSites", , , "ProjNumber = Me.txtInputPN1"
DoCmd.Close acForm, "ztestNavButton"
End Sub


The button SORT OF works....but when I press it, it brings up a NEW dialog called "Enter Parameter Value" with identifier Me.txtInputPN1. If I enter the same Project Number there as I did in the text box, my form opens to the record I intended and life is good. But I just can't figure out what is wrong with my original "Me.txtInputPN1" argument such that Access doesn't recognize it. It seems that the rest of the code does what I want...

I hope this is obvious to someone else, as I'm on a tight deadline and getting deeper and deeper into the weeds with this thing! Thanks to anyone with suggestions!!!
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jun 2011
Posts: 2
 
      12th Jun 2011
Okay, I got a little sleep and then came back to this. Finally found some online info that made a difference. Functional code:

Private Sub Command4_Click()
DoCmd.OpenForm "frmProjectSites", , , "[ProjNumber]='" & Me.txtInputPN1 & "'"
DoCmd.Close acForm, "ztestNavButton"
End Sub
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Query Using A custom form NoviceAccessUser-Melanie Microsoft Access Queries 2 31st Jul 2008 08:24 PM
Custom PopUpBox in Parameter Query Nad Microsoft Access 0 6th Dec 2007 10:16 AM
custom switchboard with parameter query command =?Utf-8?B?TWFyeQ==?= Microsoft Access Forms 1 22nd Aug 2007 08:38 PM
custom dialog for parameter query =?Utf-8?B?U3Rhbg==?= Microsoft Access Queries 2 17th Jun 2005 03:58 PM
Create a custom dialog box to use with a parameter query Suzanne Wyatt Microsoft Access Form Coding 4 6th Oct 2003 05:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 AM.