Help with Visual Basic

  • Thread starter Thread starter FollanA
  • Start date Start date
F

FollanA

Guest
Hi All,

I am only new to VB and need your assistance.

I have created a form which inserts some data into a table but what I also want it to do is populate a report with the data entered and then e-mail the report to a designated e-mail address.

Do I need to use VB for this or is there a way to do this in Access without using VB?

Any help on where to begin would be most appreciated.

Cheers,
Andrew
 
Maybe i need to tackle this step by step....

My command button now inserts the new record into the table and then opens the report. How do I open the report to only show the record I just inserted?

my VB script at the moment is:

DoCmd.GoToRecord , , acNewRec
DoCmd.OpenReport "RPT_customer_incident_report", acViewPreview, , , , ""

As you can see I am trying to step through this slowly :)

Cheers.
 
You can use a macro to email the report. The macro first needs to open the report before you email it though. Set the Report's Control Source to a Table/Query
 
How To Make Comparison Between 3 Records Based On Priority?

I'm having a problem to select a record which is based on priority. It can solve by the If Then Else statement, but I am new to VBA, therefore don't know how to code. Here is the example of the data,there are three fileds as below:

File No Descripition Type
DSF/100 Monitor Continue
DSF/100 CPU Replace
DSF/100 Printer New

If there are more than 1 record which having same File No, then I need to select the record based on the Type field, and the Type field has priotity as below:

1) Replace
2) Continue
3) New

The priority first is "Replace", second is "Continue" and the third is "New".
So, based on the example above, the record I want is the record which type is Replace. If there is no "Replace" like:

File No Descripition Type
DSF/100 Monitor Continue
DSF/100 Printer New

The record I want is the type of "Continue" and so on.
Anyone expert in VBA can answer my question?

Thank you in advanced.
 
modest said:
You can use a macro to email the report. The macro first needs to open the report before you email it though. Set the Report's Control Source to a Table/Query

Hi Modest,

Ok that makes sense.

I am still unsure though how I would only select the current record in the report. At the moment when I try this it recalls all the records and then makes a 5 - 6 page report.

Thanks for your help.

Andrew
 
FollanA said:
I am still unsure though how I would only select the current record in the report
In your query, use the WHERE clause to filter the report.

Or apply a filter to the actual report.
 

Users who are viewing this thread

Back
Top Bottom