copy

C

Chey

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
 
S

schasteen

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

schasteen said:
Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

Chey said:
I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

schasteen said:
My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

schasteen said:
Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

Chey said:
I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




Chey said:
I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

schasteen said:
My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

schasteen said:
Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

schasteen said:
Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




Chey said:
I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

schasteen said:
My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Add
Forms![Travel Request 0 Layover].requery after you copy the value
Chey said:
Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

schasteen said:
Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




Chey said:
I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

Thanks you so much it works perfectly.

schasteen said:
Add
Forms![Travel Request 0 Layover].requery after you copy the value
Chey said:
Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

schasteen said:
Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Glad to help

Chey said:
Thanks you so much it works perfectly.

schasteen said:
Add
Forms![Travel Request 0 Layover].requery after you copy the value
Chey said:
Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

schasteen said:
Glad to help

Chey said:
Thanks you so much it works perfectly.

schasteen said:
Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

I can try, but I am unsure what you are needing. Can you please give me some
more details?

Chey said:
well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

schasteen said:
Glad to help

Chey said:
Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

schasteen said:
I can try, but I am unsure what you are needing. Can you please give me some
more details?

Chey said:
well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

schasteen said:
Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


Chey said:
Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

schasteen said:
I can try, but I am unsure what you are needing. Can you please give me some
more details?

Chey said:
well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

schasteen said:
Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


Chey said:
Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

schasteen said:
I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

What does the error message say? There should be no problem with a subform.

Chey said:
well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

schasteen said:
Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


Chey said:
Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

:

I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

run time error 13
Data Type mismatch

Thanks again for all your help. You are terrific!!!!!

schasteen said:
What does the error message say? There should be no problem with a subform.

Chey said:
well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

schasteen said:
Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


:

Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

:

I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

Can you still help me I am so close to finishing this?
Thanks

Chey said:
run time error 13
Data Type mismatch

Thanks again for all your help. You are terrific!!!!!

schasteen said:
What does the error message say? There should be no problem with a subform.

Chey said:
well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

:

Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


:

Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

:

I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
S

schasteen

Change
Dim TANo as integer
to
Dim TANo as variant
Chey said:
Can you still help me I am so close to finishing this?
Thanks

Chey said:
run time error 13
Data Type mismatch

Thanks again for all your help. You are terrific!!!!!

schasteen said:
What does the error message say? There should be no problem with a subform.

:

well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

:

Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


:

Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

:

I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 
C

Chey

You can't assign a value to this object
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Me.FilterOn = True

Thanks

So still my goal is to when it pastes to the other form for it to make that
record current plus filtered so the person can not move from one record to
the next.


schasteen said:
Change
Dim TANo as integer
to
Dim TANo as variant
Chey said:
Can you still help me I am so close to finishing this?
Thanks

Chey said:
run time error 13
Data Type mismatch

Thanks again for all your help. You are terrific!!!!!

:

What does the error message say? There should be no problem with a subform.

:

well right now the line TANo = Me.[TA Numbers].Form![TA Number] get
highlingeted Forms TA Numers is a sub form, could that have something to do
with it? And my field name is indeed TA Number.
Thanks.
It would be great if I could get this to work.
Thanks again

:

Not sure but try this
Dim TANo as integer

TANo = Me.[TA Numbers].Form![TA Number]

Forms![Travel Request 0 Layover]![Travel Request.TA Number] = TANo
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Forms![Travel Request 0 Layover].Filter = "[TA Numbers]=" & TANo
Forms![Travel Request 0 Layover].FilterOn = True


:

Okay so this is the code you have helped me with
Forms![Travel Request 0 Layover]![Travel Request.TA Number] = Me.[TA
Numbers].Form![TA Number]
DoCmd.Close
Forms![Travel Request 0 Layover].Requery
Me.Filter = "[TA Numbers]=" & Me![TA Numbers]
Me.FilterOn = True
Now when it gets pasted it need to filter that TA number only then I think
it need to requery to make the information pop up so what I just want what I
had pasted to be present. I just realized that I have three regions using
this. 1 region has 1-99 the region 2 has 100-199 and region 3 has 200-299.
So this all ends up feeding into one form. THanks for your help.

:

I can try, but I am unsure what you are needing. Can you please give me some
more details?

:

well I guess you haven't hered the last of me. Something else I need is it
to filter the TA number I just pasted. Before I had it go to last then
filter. Can you help me code that.
Thanks a bunch

:

Glad to help

:

Thanks you so much it works perfectly.

:

Add
Forms![Travel Request 0 Layover].requery after you copy the value
:

Ok I guess I need to add one more thing. When it paste I want it to carry
over the information that I just put in. So maybe I need a refresh
somewhere?
Before how I had it was when I clicked on TA Number it copied then when you
click in TA number on the the form it pops up all the information I had just
typed in.
Thanks for your help.

:

Ok if I am understanding properly, you have the form Travel Reqest 0 open and
then you open th Final TA number form from a button on Travel Reqest 0. Then
in the on click event on the button on the Final TA numberform you want to
copy a value from the subform. This is fairly easy, all you have to do is

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

This line of code copys the value from the subform to the other. You do not
need to worry about setting focus and other steps. One change is if the
button to copy is on the subform and not the main the code woud be

Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA Number]

Then put the docmd.close to close the form.




:

I am still confussed.
Okay here is what is fully going on. I open the form Travel Reqest 0
Layovers. I have a command button that opens another form Called Final TA
Number with a subform called TA Number. On that form I then have another
command button. Here I want it to do the following.
Set focus to the TA Number Field
Copy the field
Close the form
-So now it is back to the original form
Set focus on Travel Request.TA Number
and paste.
This is the full process that I would like to do.
I tried to do it in macors but got hung up on the gotocontrol part. I don't
know if it was becasue of the sub form or not.
Any ways thanks for all the help. I am a little slow when it comes to so
much coding.
Thanks again

:

My bad, I did not read the full question before answering. I got ahead of
myself.

DoCmd.OpenForm "Travel Request 0 Layover"
' I am assuming that the form opens to where you want to copy to or else you
will need to filter or goto the correct record
Forms![Travel Request 0 Layover]![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]
Docmd.close

or you could define a variable

Dim TANo as variant 'made it variant because i am unsure of your data type

TANo = Me.[TA Numbers].Form![TA Number]
docmd.close
DoCmd.OpenForm "Travel Request 0 Layover"
Forms![Travel Request 0 Layover]![Travel Request.TA] = TANo

:

Not fully sure if Travel reuest 0 Layover is a new for or sub, so you will
have to modiy to make it work
Me.[Travel Request 0 Layover].Form![Travel Request.TA ] = Me.[TA
Numbers].Form![TA Number]

:

I have a cody going.
This is what I have so far
Me.[TA Numbers].Form![TA Number].SetFocus
DoCmd.CopyObject it goes good until here. How do I get it to copy and then
paste under Travel Request 0 Layover then field name Travel Request.TA Number?

DoCmd.Close
DoCmd.OpenForm "Travel Request 0 Layover"
 

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

go to 2
invalid bracketing 1
Check box-email 0
Add some stuff to code 7
run time error 2498 0
email in access 2
Excel does not accept text format! 0
Revise code 2

Top