value problem

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
 
N

Nikos Yannacopoulos

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
 
A

Andi Mayer

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top