Access Data Base programming

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Gents,
Good Day,
I would like to have assistance, if some be kind.
1- I am applying formaula to calculate dates with times "DateDiiff()"
but reslulte is not coming properly. (I want to calculate days, hours etc. I
am usind iterval "d" and "h".)
If some one come up with the expected mistakes, which I doing.



2. Secondly, I want to fix micro to print only current page of forms
not whole set.

Thanks,




Wajid
 
Hi,
In your code wizzard where you tell your application to what to do you tell
is to avg. or sum / for divide on your time & date. Go to your Access help
and type in time & date examples. It will give you examples of what type code
to type in for your calulations. Like [is ending date]&[is starting date]
hope this was some help!
 
Wajid said:
I would like to have assistance, if some be kind.
1- I am applying formaula to calculate dates with times "DateDiiff()"
but reslulte is not coming properly. (I want to calculate days, hours
etc. I
am usind iterval "d" and "h".)
If some one come up with the expected mistakes, which I doing.

2. Secondly, I want to fix micro to print only current page of forms
not whole set.
Hi Wajid,

1) I suggest using Doug and Graham's Diff2Dates function:

http://www.accessmvp.com/djsteele/Diff2Dates.html

2) Simplest way to *print the form* for record 15
is to navigate to record 15
(so form shows values for record 15),
then from top menu, select File/Print
which should bring up a Print dialog box.
In "Print Range", set to "Selected Record(s)"
and click on OK.

This should print the *form* for only record 15.

Or you can add a command button to your form.
In the wizard that comes up choose

Categories: Form Operations
Actions: Print Current Form

Then when ever you click on this command button,
it will print the form for *all* the records.

It will create code like:

Private Sub Command33_Click()
On Error GoTo Err_Command33_Click


DoCmd.PrintOut

Exit_Command33_Click:
Exit Sub

Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click

End Sub

To get it to print ONLY the current record,
you need to add " acSelection" to the
PrintOut stmt.

DoCmd.PrintOut acSelection

Then when you click on the command button,
it will print the form for the current record only.


Private Sub cmdPrintFormThisRecord_Click()
On Error GoTo Err_cmdPrintRecord_Click

DoCmd.PrintOut acSelection

Exit_cmdPrintRecord_Click:
Exit Sub

Err_cmdPrintRecord_Click:
MsgBox Err.Description
Resume Exit_cmdPrintRecord_Click

End Sub

As you become more experienced though,
I think you will realize that you really want
to do all printing via REPORTS.

http://www.mvps.org/access/reports/rpt0002.htm

good luck,

gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top