Print one record for a report help?

whojstall11

Registered User.
Local time
Yesterday, 23:51
Joined
Sep 7, 2011
Messages
94
Well i have enter in my code to print one record on my report and when i click on the button (Patient Medication) i made for it nothing happens!C an anybody help?.............................. My database would not attach so i had to make a rapidshare file its safe

 
pleaassaaaassssssssssssssss
 
Well i have enter in my code to print one record on my report and when i click on the button (Patient Medication) i made for it nothing happens!C an anybody help?.............................. My database would not attach so i had to make a rapidshare file its safe

Are you using a form and then wanting to print the individual record you are on, if so then do the following:

Open the form in design view then press F11 (this will bring the database window to the front). Then select Macros, create a new macro and select the following action

OpenReport

In the arguments below

Select the Report name
Select Print Preview
In the Conditions select the elipsee button on the right and then double click the Forms section and loaded forms, then select your form and select the ID field, then add the = sign and then double click the table and the ID field, click OK.

Save the macro with a name something like mcrPreviewIndividualRecord

Then close the Macro down, next drag the macro onto your form (it will create a button for you) then save the form and change the view select a record and click the button and you should get a preview of one record.
 
As previously stated, use your General table and the MR record number field in the Conditions of your macro.
 
We don't need the link. Paste the code here.


This person is using an embedded macro, so he only needs to add the condition to the General table and form as suggested, as I have looked at this.
 
@Trevor G thank you it works but when i run it nothings prints out here are my arguments [Forms]![Patient Data]![MRN]=[Forms]![Patient Data]![Patient First Name] @ vbaInet Option Compare Database

Private Sub New_Entry_Click()
On Error GoTo Err_New_Entry_Click


DoCmd.GoToRecord , , acNewRec

Exit_New_Entry_Click:
Exit Sub

Err_New_Entry_Click:
MsgBox Err.Description
Resume Exit_New_Entry_Click

End Sub

Private Sub Form_Click()
Dim strPatientsMeds As String
Dim strWhere As String
strPatientsMeds = "Patient Medication Records"
strWhere = "[Patient Data]=" & Me!PatientData & ""
DoCmd.GoToRecord strPatientsMeds, acPreview, , strWhere

End Sub

Private Sub Open_Patients_Meds_Click()


End Sub
 
This person is using an embedded macro, so he only needs to add the condition to the General table and form as suggested, as I have looked at this.
My reply just keeps coming late :eek:

I will leave it in your capable hands :)
 
Sorry to cross over when you are replying as well

This is wrong

[Forms]![Patient Data]![MRN]=[Forms]![Patient Data]![Patient First Name]

You have to go back to the table in the conditions and it has to be equal to the MRN number not Patient First Name.

So you need this

[Forms]![Patient Data]![MRN]=[General]![MRN]

Tested and it works.....
 
I have another problem can you guys help basically im trying to have the person looking for data, type in any part of information of the patient they are looking such as: name dob etc.............. when typed in the Search Form the results go to the Search Results subform then when you find the data you are looking for it suppose to send you to the Patient Data form so they will be able to edit it or to look at all thier information. its in 2007 I cant convert it to 2003 it wont let me
 

Attachments

For separate problems use a new thread. It is easier for people to figure out what the thread is talking about and it makes it more likely that other people, besides the ones already in the current thread, will participate.
 
Oh, and if you are posting in multiple forums, it is good if you get an answer that works, to post a link in the other(s) so people don't duplicate the efforts to answer that which was already answered. :)
 

Users who are viewing this thread

Back
Top Bottom