How to query the caption of a command button (1 Viewer)

MacFil

Registered User.
Local time
Today, 06:20
Joined
Nov 30, 2004
Messages
15
G'day all

I want to create a form that will be the layout of my storage warehouse. I actualy have a layout on paper but was thinking of doing it on a form for the users to have a better view. The location of the inside warehouse have 60 location or Bin. The outside one has 80 Bins.
This will need 2 query. 1 for the inside Bins and 1 for the outside Bins. They are both the same query except for the caption of each command button.

What will be the beast way to create the query as to the criteria is to read from thee caption of the command button.
If the caption is 50 then give me everything in 50.

Hope this make since.

Thanks you so much.
JP
 

antomack

Registered User.
Local time
Today, 11:20
Joined
Jan 31, 2002
Messages
215
You can use the following string as your criteria in a query to use the value of the text in the caption of a command button.

[forms]![YourFormName]![YourCommandButtonName].caption
 

MacFil

Registered User.
Local time
Today, 06:20
Joined
Nov 30, 2004
Messages
15
Thank you for the reply Antomack

I will have 60 command button wich the name will start with cmd01 up to cmd60.

If I click on the button 01 the command button name wil be cmd01. If I click on 35 the the button name will be cmd35.. and so on.

Will I have to create 60 querys or is there a way I can have only 1 query to read off the command button name and run the query.

Thank you.
JP
 

Users who are viewing this thread

Top Bottom