Automatically fill in field of a new record, based on related reco

T

Tammy

Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 
K

KARL DEWEY

You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
 
T

Tammy

Thanks so much for answering my post, Karl.

My user does have a datasheet already displayed on the property form, so he
can add new records there directly. However, he would also like the ability
to click a button on the property form that takes him to a new record on his
building form - where he has fields layed out in a specific manner. When he
gets there, he would like the property number automatically filled in before
he adds the rest of the building data.

I can get him to the building form, and even filter out the buildings based
on a property, but when you click the "new" button to add a new building, you
still have to enter the property number associated with the property.

Thanks, again, for any suggestions?


KARL DEWEY said:
You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
--
KARL DEWEY
Build a little - Test a little


Tammy said:
Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 
K

KARL DEWEY

Using the form/subform with Master/Child links on strPropertyNum the link
automatically fills the property number associated with the property.

--
KARL DEWEY
Build a little - Test a little


Tammy said:
Thanks so much for answering my post, Karl.

My user does have a datasheet already displayed on the property form, so he
can add new records there directly. However, he would also like the ability
to click a button on the property form that takes him to a new record on his
building form - where he has fields layed out in a specific manner. When he
gets there, he would like the property number automatically filled in before
he adds the rest of the building data.

I can get him to the building form, and even filter out the buildings based
on a property, but when you click the "new" button to add a new building, you
still have to enter the property number associated with the property.

Thanks, again, for any suggestions?


KARL DEWEY said:
You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
--
KARL DEWEY
Build a little - Test a little


Tammy said:
Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 
T

Tammy

Thanks, again, Karl. I'm sorry if I'm just being dumb on this one...

I guess I'm confused. I already have two forms created - one for properties,
one for buildings. I do not want a subform added to my property form. When I
have a property displayed on the property form, I would like to go to the
building form with a new record ready to be filled out, but have the property
number I was just looking at on the property form already filled in on the
new record in the building form.

How do I get to the buidling form from the property form? Again, sorry if
I'm just missing your point.

Thanks!

KARL DEWEY said:
Using the form/subform with Master/Child links on strPropertyNum the link
automatically fills the property number associated with the property.

--
KARL DEWEY
Build a little - Test a little


Tammy said:
Thanks so much for answering my post, Karl.

My user does have a datasheet already displayed on the property form, so he
can add new records there directly. However, he would also like the ability
to click a button on the property form that takes him to a new record on his
building form - where he has fields layed out in a specific manner. When he
gets there, he would like the property number automatically filled in before
he adds the rest of the building data.

I can get him to the building form, and even filter out the buildings based
on a property, but when you click the "new" button to add a new building, you
still have to enter the property number associated with the property.

Thanks, again, for any suggestions?


KARL DEWEY said:
You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
--
KARL DEWEY
Build a little - Test a little


:

Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 
K

KARL DEWEY

My point was to use form/suform.
Your button can call a macro that opens your form in Data Mode - Add. Then
action to Set Value of form fields from orignal form.
--
KARL DEWEY
Build a little - Test a little


Tammy said:
Thanks, again, Karl. I'm sorry if I'm just being dumb on this one...

I guess I'm confused. I already have two forms created - one for properties,
one for buildings. I do not want a subform added to my property form. When I
have a property displayed on the property form, I would like to go to the
building form with a new record ready to be filled out, but have the property
number I was just looking at on the property form already filled in on the
new record in the building form.

How do I get to the buidling form from the property form? Again, sorry if
I'm just missing your point.

Thanks!

KARL DEWEY said:
Using the form/subform with Master/Child links on strPropertyNum the link
automatically fills the property number associated with the property.

--
KARL DEWEY
Build a little - Test a little


Tammy said:
Thanks so much for answering my post, Karl.

My user does have a datasheet already displayed on the property form, so he
can add new records there directly. However, he would also like the ability
to click a button on the property form that takes him to a new record on his
building form - where he has fields layed out in a specific manner. When he
gets there, he would like the property number automatically filled in before
he adds the rest of the building data.

I can get him to the building form, and even filter out the buildings based
on a property, but when you click the "new" button to add a new building, you
still have to enter the property number associated with the property.

Thanks, again, for any suggestions?


:

You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
--
KARL DEWEY
Build a little - Test a little


:

Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 
T

Tammy

Hi Karl,

Thanks so much for all your help with this! The macro works great. I didn't
have all my macro actions showing and didn't see the SetValue action
previously. Sorry for any confusion I created with my initial post.

Thanks, again, for taking the time to help me out with this - I really
appreciate it. Have a great day!

KARL DEWEY said:
My point was to use form/suform.
Your button can call a macro that opens your form in Data Mode - Add. Then
action to Set Value of form fields from orignal form.
--
KARL DEWEY
Build a little - Test a little


Tammy said:
Thanks, again, Karl. I'm sorry if I'm just being dumb on this one...

I guess I'm confused. I already have two forms created - one for properties,
one for buildings. I do not want a subform added to my property form. When I
have a property displayed on the property form, I would like to go to the
building form with a new record ready to be filled out, but have the property
number I was just looking at on the property form already filled in on the
new record in the building form.

How do I get to the buidling form from the property form? Again, sorry if
I'm just missing your point.

Thanks!

KARL DEWEY said:
Using the form/subform with Master/Child links on strPropertyNum the link
automatically fills the property number associated with the property.

--
KARL DEWEY
Build a little - Test a little


:

Thanks so much for answering my post, Karl.

My user does have a datasheet already displayed on the property form, so he
can add new records there directly. However, he would also like the ability
to click a button on the property form that takes him to a new record on his
building form - where he has fields layed out in a specific manner. When he
gets there, he would like the property number automatically filled in before
he adds the rest of the building data.

I can get him to the building form, and even filter out the buildings based
on a property, but when you click the "new" button to add a new building, you
still have to enter the property number associated with the property.

Thanks, again, for any suggestions?


:

You do not need a button or VBA to do what you suggest. Use a form/subform
for property/building with Master/Child links on strPropertyNum.
When you open the form/subform the building form in datasheet view will
display all buildings associated with the property. Just scroll to the
bottom and add a new building.
--
KARL DEWEY
Build a little - Test a little


:

Hello - I've read quite a few posts relating to similar needs, but am not
seeing a solution for what I require. I am using Access 2007.

I have a form that displays properties (frmProperty). There is a second form
that displays the buildings for each property (frmBuilding). They are linked
together by a field called [strPropertyNum]. It is a one-to-many
relationship, with [frmProperty] being the parent.

What I would like to do is create a button on [frmProperty] that opens
[frmBuilding]. That is easy enough, however, I'd like the button to open
[frmBuilding] with a new record showing, and the property number from the
record on [frmProperty] already filled in. Using a macro, I can get the form
to open and display a new record, but how do I get the PropertyNum value to
fill in automatically? Is this possible without VBA coding?

I don't want [frmBuilding] to always open this way - only when the button is
clicked on [frmProperty].

I'm not familiar with VBA, so I'd like to try this using Access tools. I am
great at copying and pasting, however, if code is required! There may have
been a "coding" solution in with other posts, but I really don't understand
the language, so I apologize if this has been answered a million times
already. :)

Thanks for any suggestions!
 

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

Top