Opening a form from another form.

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

Guest

I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks
 
Accually I did try that :-), but it only allows me to enter one field to
match, not two. So I don't know how to link them.

Thanks for the help!
Tammy

Sprinks said:
Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks

Tammy said:
I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy

Use the Where clause argument of the OpenForm method.

Code the [Eco Log] control's Double-click event:

DoCmd.OpenForm "Eco Form", , , "[ControlName] = '" & Me![Eco Log] &
"'"

Change [ControlName] to the name of the control on the "ECO Form"
 
Tammy,

See VBA Help on the OpenForm Method. All you need to do is create a valid
SQL Where clause to assign to stLinkCriteria:

stLinkCriteria = "[fld1]=" & Me![ctl1] & "AND" & "[fld2]" = & Me![ctl2]

HTH
Sprinks

Tammy said:
Accually I did try that :-), but it only allows me to enter one field to
match, not two. So I don't know how to link them.

Thanks for the help!
Tammy

Sprinks said:
Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks

Tammy said:
I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
Hi Fred,
Nope that isnt working.
First it said that there wasnt a field called Eco log, so I changed it to
the name of the field in my Eco Log (newECO), then a paramater box poped up,
I dont want to type the number again, I want it to use the number created by
=[BaseNumber] & "-" & Format([Extension],"000"). Even if I do type in the
number it doesnt come to the correct record, just a blank one

Thanks
Tammy

fredg said:
I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy

Use the Where clause argument of the OpenForm method.

Code the [Eco Log] control's Double-click event:

DoCmd.OpenForm "Eco Form", , , "[ControlName] = '" & Me![Eco Log] &
"'"

Change [ControlName] to the name of the control on the "ECO Form"
 
Here is what I put in, and I am now getting a compile error.

stLinkCriteria = "[ECO NUMBER]=" & Me![BaseNumber] & "AND" & "[Extension]" =
& Me![newECO]

newECO is accually ECO Log field name, because the control is =[BaseNumber]
& "-" & Format([Extension],"000"), which is probably why I am getting the
compile error?




Sprinks said:
Tammy,

See VBA Help on the OpenForm Method. All you need to do is create a valid
SQL Where clause to assign to stLinkCriteria:

stLinkCriteria = "[fld1]=" & Me![ctl1] & "AND" & "[fld2]" = & Me![ctl2]

HTH
Sprinks

Tammy said:
Accually I did try that :-), but it only allows me to enter one field to
match, not two. So I don't know how to link them.

Thanks for the help!
Tammy

Sprinks said:
Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks

:

I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
Tammy,

Should be "[Extension] = ".

Good luck.
Sprinks


Tammy said:
Here is what I put in, and I am now getting a compile error.

stLinkCriteria = "[ECO NUMBER]=" & Me![BaseNumber] & "AND" & "[Extension]" =
& Me![newECO]

newECO is accually ECO Log field name, because the control is =[BaseNumber]
& "-" & Format([Extension],"000"), which is probably why I am getting the
compile error?




Sprinks said:
Tammy,

See VBA Help on the OpenForm Method. All you need to do is create a valid
SQL Where clause to assign to stLinkCriteria:

stLinkCriteria = "[fld1]=" & Me![ctl1] & "AND" & "[fld2]" = & Me![ctl2]

HTH
Sprinks

Tammy said:
Accually I did try that :-), but it only allows me to enter one field to
match, not two. So I don't know how to link them.

Thanks for the help!
Tammy

:

Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks

:

I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
Hi Sprinks, thanks for the help but now a paramater box is popping up,
I dont want to type the number again, I want it to use the number created by
=[BaseNumber] & "-" & Format([Extension],"000"). Even if I do type in the
number it doesnt go to the correct record, just a blank one

Thanks
Tammy



Sprinks said:
Tammy,

Should be "[Extension] = ".

Good luck.
Sprinks


Tammy said:
Here is what I put in, and I am now getting a compile error.

stLinkCriteria = "[ECO NUMBER]=" & Me![BaseNumber] & "AND" & "[Extension]" =
& Me![newECO]

newECO is accually ECO Log field name, because the control is =[BaseNumber]
& "-" & Format([Extension],"000"), which is probably why I am getting the
compile error?




Sprinks said:
Tammy,

See VBA Help on the OpenForm Method. All you need to do is create a valid
SQL Where clause to assign to stLinkCriteria:

stLinkCriteria = "[fld1]=" & Me![ctl1] & "AND" & "[fld2]" = & Me![ctl2]

HTH
Sprinks

:

Accually I did try that :-), but it only allows me to enter one field to
match, not two. So I don't know how to link them.

Thanks for the help!
Tammy

:

Hi, Tammy.

Easiest way is to enable the wizard in form design view; then place a
command button, choosing Form Operations/Open a Form, and telling it what
specific data to match. Then cut and paste the code generated to your ECO
log textbox' OnDoubleClick Event Procedure.

Or, if these forms have the same RecordSource, a Tabbed form is more
convenient.

Hope that helps.
Sprinks

:

I have a form called "ECO Log", it has a text box with the following control
source =[BaseNumber] & "-" & Format([Extension],"000")

I also have another form called "ECO Form" that also has a text box with the
same control source =[BaseNumber] & "-" & Format([Extension],"000")

What I want to do is double click on the "ECO Log" text box and bring up the
same record in the "ECO Form" text box, so I can enter more data.

Any help would be greatly appreciated!!
Tammy
 
Back
Top