Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refer to record selector button in VBA???

Status
Not open for further replies.

cikul

Programmer
Aug 25, 2001
12
0
0
EU
How to refer to record selector button on the form?
I want command button on the form to open diferent report depending on that
if the record selector is pressed or not.
If the selector is pressed it need's to open report based on that single record and if not
then to open report based on all records. Are there any command in VBA for refering to record
selector button.
For exmpl. "If (record selector is pressed) open Report1 else open Report2
So, I need a expression that will replace (record selector is pressed).
Help ASAP
Thanx
 
There's no way to refer to the record selecter that I know of. Here's one way to do what you need:

In the click event of your print button ask them what they want to do

If MsgBox("Print current record only?" _
, vbYesNo) = vbYes Then
'print report1
Else
'print report2
End If

By the way, you shouldn't need two reports to handle this. One report being passed a wherecondition should take care of it for you. Look at help for Docmd.OpenReport "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Thnx, I did'nt wanted to put a message box, I wanted record selector to be some kind of message box, that is yes/no (selected or not) but I think that I have to do it with msgbox because few people told me that there is no way to refer to record selector.
I know that I don't need two reports but I want it to look different so I have to use two:)
BTW is there any way to change msgbox button text or I need to make form that will act as msgbox. For exmpl I want it to show "DA" instead of "YES"
Thnx again
rgrds
Sale
 
Nyet "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
I'm not sure you actually want to refer to the record selector - When you click your command button the record will be unselected anyway, won't it? You probably have or want a toggle button on your form, and you would refer to it the same way you would to any other control on the form, checking to see if it is yes or no.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top