A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Better way to utilize my form



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 26th, 2009, 09:24 PM posted to microsoft.public.access
mlieberstein
external usenet poster
 
Posts: 11
Default Better way to utilize my form

I have a user go into a Form which allows the user to select a BusinessGroup
with a combo box. Then the user has a command button on the form which
launches an event procedure.

What happens 1st is:

An expression in a Query that says [Enter a YearMonthValue: yyyymm] (comes
via a msgbox)
Then the following code is executed:

Private Sub cmd_OpenReport_Click()

DoCmd.OpenReport "BusinessGroupReport_rpt", acViewPreview, , "[Business
Group I] = '" & Me.cbxBusinessGroup & "'"
DoCmd.RunCommand acCmdPrint

End Sub

This works fine, but is there a better way?

---I’d like for the user to 1st enter the YearMonthValue in a text box on my
form, then select a BusinessGroup in the ComboBox. Then use a command Button
to use both the text box and the combo box data as filters to OpenReport.


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.