UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> create a menu from a query    
 
   
stevendambra
post Oct 28 2004, 10:43 PM
Post #1

UtterAccess Member
Posts: 21



I hope i'm going about this correctly...
(part 1) After a user runs a query,
(part 2)the results will return by the field "Last Name" in some sort of a menu.
(part 3) If they click on "Last Name", the form will pop up on screen and show all information.

Any resources that could direct me upon going about this?
link and such?
I'm trying to find info on part 2 and 3.
Go to the top of the page
 
+
bekibutton
post Oct 29 2004, 02:58 AM
Post #2

UtterAccess Guru
Posts: 726
From: UK



Welcome to UA (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)

I personally do this with a listbox. Mine is based on an SQL query but I guess it works with a 'parameter' query too (as the rowsource). I have it bring up the results in the listbox and then set the OnClick or DoubleClick event to open the form, filtered by the item clicked in the listbox. I hope that makes sense! I'll have a look around for some articles etc. if you want (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)

Hope this helps,

Becki
Go to the top of the page
 
+
stevendambra
post Oct 29 2004, 11:14 AM
Post #3

UtterAccess Member
Posts: 21



thank you very much.
You solved my problem.
Much thanks

btw, i'm a lurker on her. Hardly ever post, but sure do read alot.
Go to the top of the page
 
+
stevendambra
post Oct 31 2004, 05:33 PM
Post #4

UtterAccess Member
Posts: 21



any tips on how to open a form through a listbox?
Go to the top of the page
 
+
bekibutton
post Nov 1 2004, 03:52 AM
Post #5

UtterAccess Guru
Posts: 726
From: UK



I use the OnClick or OnDoubleClick event of the listbox and do something like:
CODE
Private Sub lboMenu_Click()
On Error GoTo Err_lboMenu_Click

Dim stLinkCriteria As String
Dim stDocName As String

stLinkCriteria = "[id]=" & Me.lboMenu.Column(2) & ""
stDocName = "frmComplete"

DoCmd.OpenForm stDocName, , , stLinkCriteria    
DoCmd.Close acForm, "frmMenu"

Exit_frmMenu_Click:
    Exit Sub

Err_frmMenu_Click:
    MsgBox Err.Description
    Resume Exit_frmMenu_Click
    
End Sub

This basically opens the form where "id" equals the [id] value in column 2 of my listbox. You can set it to open using the data from any column.

If your data is text then you need single quotes around your listbox value, ie:

"[UserName]='" & Me.lboMenu.Column(2) & "'"

Or if it's a date then the quotemarks should be '#'.

Hope that helps!
Becki
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 06:52 AM