value problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
A user would like a new form (reason) to open when box_no field = "vp corr"
or "rr corr" so can add reason for correction the form reason would need to
have works order no and fg code from original form as well as reason text box
i have written following but do not know how to fill works order box on
reason form with works order value from original form
Thanks
private sub box_no_afterupdate()
dim stdocname as string
dim stlinkcriteria as string
if mid(box_no.value,4,4) = "corr" then
stDocname = "reason"
docmd.openform stdocname, , , stlinkcriteria
else
end if
 
Tina,

Try this:

Private Sub box_no_afterupdate()
dim stdocname as string
dim stlinkcriteria as string
if mid(box_no.value,4,4) = "corr" then
var1 = Me.[works order no]
var2 = Me.[fg code]
stDocname = "reason"
docmd.openform stdocname, , , stlinkcriteria
Forms(stdocname).[works order no] = var1
Forms(stdocname).[fg code] = var2
End if
End Sub

I had to guess the names of the controls, hope it is evident which is
which so you can change to the actual names.

HTH,
Nikos
 
On Wed, 16 Feb 2005 06:27:04 -0800, "tina"

answer inside the sub assuming that both field are named [WORKS Order]
Hi
A user would like a new form (reason) to open when box_no field = "vp corr"
or "rr corr" so can add reason for correction the form reason would need to
have works order no and fg code from original form as well as reason text box
i have written following but do not know how to fill works order box on
reason form with works order value from original form
Thanks
private sub box_no_afterupdate()
dim stdocname as string
dim stlinkcriteria as string
if mid(box_no.value,4,4) = "corr" then
stDocname = "reason"
docmd.openform stdocname, , , stlinkcriteria
forms(stDocname).[WORKS Order]=me.[WORKS Order]
 
Back
Top