Append queries

lynsey2

Registered User.
Local time
Today, 00:08
Joined
Jun 18, 2002
Messages
439
Good morning all!

just a wee prob! not sure how to fix it

have made an append query so that when a patient is selected from a combo box the query makes it so their details are held in a temp table

Problem

the append takes all the records from the combo box and not just the one selected:confused: v.confused:confused:

any ideas!:D ill be happy to hear
 
Lynsey. Refer to the ComboBox in the criteria of the append query.

[forms]![YourFormName]![cboComboBoxName]

David
 
Create an invisible text box on your form with source=[your combobox]. Make that text box value a criteria in your append query.
On the combo box itself On change propery need to have refresh or requery specified:
ex:
Private Sub Combo6_Change()
On Error GoTo Combo6_Change_Err

DoCmd.Requery "Step3 subform"


Combo6_Change_Exit:
Exit Sub

Combo6_Change_Err:
MsgBox Error$
Resume Combo6_Change_Exit

End Sub
This example refreshes the subform that holds the result of the query, but you can modify it to suit your needs.

Not the most elegant, but it works...:rolleyes:

HTH

Chris
 
Hi Lynsey,

did you use the format Forms!YourForm!YourCombo as the query criteria?

That's all I can think of!

Rich :p
 
OK,

Someone had the CHEEK to beat me to it, while I was typing!:mad: :mad:
 
ok guys i like what you gave me but have no clue where its to go im sending what i have but im going home now cos its my birthday and i have had enough......im going to paartaaay!!!!
ill try and start again on mon

Private Sub patient_detailsqry_Click()
On Error GoTo Err_patient_detailsqry_Click

Dim stDocName As String

stDocName = "Patient Detailqry"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_patient_detailsqry_Click:
Exit Sub

Err_patient_detailsqry_Click:
MsgBox Err.Description
Resume Exit_patient_detailsqry_Click

End Sub
 
Ok I am not having any luck with this today so far...

I have just deleted everything to do with the qry and am going to start again. I tried to do the criteria but it will not let me...something to do with asterix.*
Thanx
ill let you know how i get on!
 

Users who are viewing this thread

Back
Top Bottom