lynsey2
Registered User.
- Local time
- Today, 16:50
- Joined
- Jun 18, 2002
- Messages
- 439
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
is the code i have in the on click event of a button on a form.
what i want to do though is fill out
Dose mg,
Clear/sugarfree and comments on the form.
so how would i do that???
Private Sub BaselineMeth_Click()
On Error GoTo Err_BaselineMeth_Click
Dim stDocName As String
stDocName = "baselineMeth Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Dose_mg = baselineMeth_Query!Dose_mg
if baselineMeth_Query!clearCheck = true then
Clearcheck = true
if baselineMeth_Query!SugarFreeCheck = true then
SugarFreeCheck = true
end if
Exit_BaselineMeth_Click:
Exit Sub
Err_BaselineMeth_Click:
Msgbox Err.Description
Resume Exit_BaselineMeth_Click
End Sub
as you can see i dont do code very well so please excuse the poor attempt but i thought that in theory that would be what i would need to do...run the qry select the fields i need and fill out the fields in the form that match the qry result! and are what i need!
Please help me this is all getting too much if you get this then you might be able to help with my History problem too if you wouldnt mind. i kinda suppose these problems are quite alike. Im not very good at helping people get my problems so if you need a better explanation then just let me know!
thanks in advance!
Lyns

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
is the code i have in the on click event of a button on a form.
what i want to do though is fill out
Dose mg,
Clear/sugarfree and comments on the form.
so how would i do that???
Private Sub BaselineMeth_Click()
On Error GoTo Err_BaselineMeth_Click
Dim stDocName As String
stDocName = "baselineMeth Query"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Dose_mg = baselineMeth_Query!Dose_mg
if baselineMeth_Query!clearCheck = true then
Clearcheck = true
if baselineMeth_Query!SugarFreeCheck = true then
SugarFreeCheck = true
end if
Exit_BaselineMeth_Click:
Exit Sub
Err_BaselineMeth_Click:
Msgbox Err.Description
Resume Exit_BaselineMeth_Click
End Sub
as you can see i dont do code very well so please excuse the poor attempt but i thought that in theory that would be what i would need to do...run the qry select the fields i need and fill out the fields in the form that match the qry result! and are what i need!
Please help me this is all getting too much if you get this then you might be able to help with my History problem too if you wouldnt mind. i kinda suppose these problems are quite alike. Im not very good at helping people get my problems so if you need a better explanation then just let me know!
thanks in advance!
Lyns