pop up forms

lynsey2

Registered User.
Local time
Today, 21:40
Joined
Jun 18, 2002
Messages
439
i have searched and dont see anything relative..

i would like to have a button on one of my forms, call the button history and when the button is clicked on i would like a pop up form to come up and show either the last 12 or so prescriptions or all the prescriptions that a selected patient has had prescribed.

E.G.
the doc opens the db goes into search for a patient the clicks on one of two buttons CreateMeth Script or Create ART script this takes the doc to another form where the doc can prescribe drugs for the selected patient....

THE HARD BIT.

i would like to be able to click on the history button and have a pop up form in datasheet view show the selected patients past prescriptions...the doc can click on one of the records in the pop up form and that record should fill out in the prescription prescribing form where all the doc has to do is change the date...kinda like a repeat prescription to save typing/selecting drugs etc all over, just click on history see the one you want to repeat and change the date!

GOOD IDEA/BAD IDEA i mucked up the original bit as people say to me i should have had the prescription prescribing forms as sub forms but well they work now so ill learn for the future.
I would like to know before i start this if this would be a good structure to get what i want ...im gonna need help too though!:rolleyes:
 
I wouldn't say it's necessarily good or bad. More of a matter of preference. Another thing you might consider is using a listbox instead of a form in datasheet view.
 
thanks, im creating a qry that goes through the history table and matches the selected patient number right now cos well i recon that will be my first point of call, filter the table to only show the selected patients past scripts...its from there ill b stuck!

cheers for getting back to me!
 
i created my qry using the wizard, in the criteria of patient number i set it up so that it looks for the patient number that is in search patient! then i created a button in the prescription prescribing form called history when clicked on it runs the qry.

PROBLEM

when clicking on the history button it prompts you for the patient number instead of looking up the patient number in select patient!
However it is almost working as if you type in the patient number it does only show you the scripts for the patient number you type in, i basically want it to do this automaticaly.

any clues, something to do with st linkcriteria....????:confused: :D
 
Last edited:
still didnt work this out...any clues welcome!:)
 
What is the criteria in your query. If you want it to link up to the patient in the other form make the criteria this:

[Forms]![Name of 1st form]![Name of txtbox for patient #]
 
thats what i have

Forms!Search_Patient!combo43

thats using the patient number criteria bit!
 
Just to be sure, the patient number is the bound column in the combo box?

Also, post your code too.
 
Either combo43 isn't the name of your combo or the patient ID is not the bound column, try
Forms!Search_Patient!combo43.Column(0) if the patient ID is the first column
 
right my combo box is called combo43
it is not bound!
patient number is the first column.
i tried making the combo box bound to patient number and it doesnt like it, i also tried that code and got an error message

i have created a qry to do this included all the feilds in the table and in the criteria of patient number i have
Forms!Search_Patient!combo43

the only other code i have is in the button on my form that runs the qry which is:

Private Sub BaselineMeth_Click()
On Error GoTo Err_BaselineMeth_Click

Dim stDocName As String

stDocName = "baselineMeth Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_BaselineMeth_Click:
Exit Sub

Err_BaselineMeth_Click:
Msgbox Err.Description
Resume Exit_BaselineMeth_Click

End Sub
 
Instead of opening a query you might want to setup a form that is bound to that query and then open that form. That way you can put a button on there to open the patient form.

You'll need to have the combobox bound to a recordsource or else your criteria won't pick up anything.

You'll only need the patient number and the patient's name if you want that to display. Make sure the patient # is the 1st column then set the bound column in the combobox to 1.
 
Add an unbound textbox to the form, set its control source to =[Combo43] change the criteria to reference the new textbox instead
 
Cheers guys! Ill give that a bash and let you know how i get on! Thanks for replying.
:D
 
Rich just tried doing what you said and it doesnt change anything! it works in the fact that the unbound combo shows patient number but when i click on the button to see the basline it still asks for the patient number.
 
You've got to make sure that the bound column in the combobox is set to the column number of the recordsource where the patient number is. Otherwise the only thing the combobox can do is display data. You can pull any info from it without a bound column.
 
Put some dummy data in and post it here, it'll have to be in 97ver though, the method I gave you will work I use it all the time, what does the unbound TEXTBOX display?
 
im not gonna even tell you i dont know how to convert back to 97....:D
the unbound Text box shows the patient number as soon as i select it from the combo box.:rolleyes: what is it with me...it should work yet again but doesnt, bet if someone else had done it everything would work like a treat!
 
Now you have to reference that textbox in the criteria as
Forms!MyForm!Text31 not the combo
 
If the combobox was bound to the wrong column wouldn't it just not show any Data? For it to be asking for a parameter it has to be a problem with the naming. But then again I could be wrong.:p

Try this anyway:
Go into the query (design mode).
Select the criteria you have in there now and delete it.
Right click where you enter the criteria and select "build".
In the window that pops up double click on "Forms".
Then double click on All Forms.
Select your form (Search_patient ?) from the list.
In the middle list, find the name of your combo box and double click it.
This should add a reference to it in the top part of the window.
Then click OK, which will take you back to your query and insert the reference for you.

If that doesn't work then your on your own!!! :eek:

:D Just Kidding. ;)

Dave
 

Users who are viewing this thread

Back
Top Bottom