|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have asked this before, however still am lost!
I have written a code to select a record from the control form when opening a report to print. The isea is that the control form data is duplicated onto the report once the control button has been selected, from this the report containing the same data as the just entered recordset of the form will be displayed. Below is the Code:- DoCmd.Close acForm, "NCR Report3" DoCmd.OpenReport "Scrap Ident Docket", acViewPreview, "Scrap Docket ID select", ID = [Forms]![NCR Report3]![ID] DoCmd.Maximize Beep MsgBox "Place defective Item and NCR Docket on you're relevant quarantine area - OK to continue" _ , vbOKCancel + vbDefaultButton1 + vbInformation, "Deficiency Entered" If Click = (1) Then DoCmd.PrintOut acPrintAll, , , acHigh, 1, True DoCmd.OpenForm "NCR Reporting2", acNormal, "", "", , acNormal DoCmd.Close acForm, "Scrap Indent Docket" Else DoCmd.Close acForm, "Scrap Indent Docket" DoCmd.OpenForm "NCR Report3", acNormal, "", "", , acNormal Can anybody help, when the report opens it is blank |
|
#2
|
|||
|
|||
|
What's the DoCmd??
|
|
#3
|
|||
|
|||
|
It's VBA, it;s basically saying Do this, as in open the form e.t.c
|
|
#4
|
|||
|
|||
|
DoCmd is specific to MS Access I believe.
I'm not sure how you change the records selected for a report though. |
|
#5
|
|||
|
|||
|
THx for your introduce,Doug G!I will remember it!
|
|
#6
|
|||
|
|||
|
Hi,
just a little thought, when you open and display the report and you tell it to match the ID field to the one on the form, this wont work as you have already closed the form, am i reading this right? |
|
#7
|
|||
|
|||
|
Yeah, I noticed that and corrected the code, however the problem is still there
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Open form in Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|