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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop Up Action to alter DB calculation field?

Status
Not open for further replies.

Kenny100

Technical User
Feb 6, 2001
72
NZ
Hi Folks

I have created a Commission Report using Access and the calculations are based on historic sales as well as sales for the current month.

In one of my fields I have a Control Source set to

=IIf([dateBank] Between #01/07/01# And #31/07/01#,[comInitial],10)

Now and again I need to change these dates to a different month. Is it possible to create a pop up box using VB that asks the user for the 'between dates' i.e. 01/07/01 and 31/07/01 as soon as the Report is opened and for these values to then be entered into the Control Source?

It would be somewhat easier for the user as opposed to having to edit the Control Source in the Report directly.

Cheers for any help you can give me,

Kenny.
 
I'm still kinda green to the VB game, but if I understand you correctly, this is what I'd do.

You will have to set the field in the control source at runtime instead of design time.
To get the dates the user wanted I would make another form with 2 textboxes, Text1 & Text2. then write the statement above as follows.

=IIf([dateBank] Between #Text1.text# And #Text2.text#[comInitial],10)

You should probably have the TextBox formatted to equal the format of the query.

I'm not into access, but I hope this gives you an idea to start from. Every day above ground is a GOOD DAY!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top