By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Having a text box display by default the value of the previous record

P: 9
Hi!

I have projects that can each have several sub-projects, nested within a subform.

Usually, each of the sub-projects contained within a master project, only differ in one or two text boxes.

So when I am entering data into the first sub-project and then switch to the second one, i'd like the second to have the same information in the text boxes as the first one and then simply change the ones that are different.

This shouldn't be so very difficult, my guess would be to set the Default Value for each text box to the previous value for that same text box within the master project, but I don't know how to do this.

Thanks!!!!!!
Feb 1 '08 #1
Share this Question
Share on Google+
5 Replies


P: 4
Hi!

I have projects that can each have several sub-projects, nested within a subform.

Usually, each of the sub-projects contained within a master project, only differ in one or two text boxes.

So when I am entering data into the first sub-project and then switch to the second one, i'd like the second to have the same information in the text boxes as the first one and then simply change the ones that are different.

This shouldn't be so very difficult, my guess would be to set the Default Value for each text box to the previous value for that same text box within the master project, but I don't know how to do this.

Thanks!!!!!!
I think I understand your question correctly

Have you tried this?
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![FormName]![TextBoxName] 
Hopefully this is what you're looking for

Edit: This should be entered in the 'Control Source' for the textbox on the next form
Feb 1 '08 #2

P: 9
I think I understand your question correctly

Have you tried this?
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![FormName]![TextBoxName] 
Hopefully this is what you're looking for

Edit: This should be entered in the 'Control Source' for the textbox on the next form
Hi!!

Thanks for your reply.

The problem I have with this, is that I get a 'circular reference'-error. I believe this is because I'm not referring to *another* form but the same form.

Let me explain, I have main form and a subform, for each main form the subform contains several entries.

What I then do within the subform is, I cycle through the records that are bound to the main form.

So there are two tables basically, one that is called MAIN PROJECTS. And another called SUBPROJECTS, two seperate tables related by a one-to-many relationship (one main project ID relates to several sub project IDs)

For each MAIN PROJECT there are several SUBPROJECTS, which I can enter through a single form, specifically the subform that is within the main form.

So, basically what I'm looking for is a way to have the subform remember the previous data for each field from the previous record within the SUBPROJECT table, for the MAIN.

Ok this sounds really much more complicated than it is..
Feb 4 '08 #3

Sequin
P: 5
You can retrieve the value of the equivalent field of the previous record when entering data by pressing Ctrl + ' (apostrophe) - you could use a Sendkeys call in the OnEnter event of each textbox, but this is probably not a good idea
Feb 4 '08 #4

P: 9
You can retrieve the value of the equivalent field of the previous record when entering data by pressing Ctrl + ' (apostrophe) - you could use a Sendkeys call in the OnEnter event of each textbox, but this is probably not a good idea
Thanks!!

I did not know this shortcut.. This will work for me.
Feb 4 '08 #5

FishVal
Expert 2.5K+
P: 2,653
Hi!

I have projects that can each have several sub-projects, nested within a subform.

Usually, each of the sub-projects contained within a master project, only differ in one or two text boxes.

So when I am entering data into the first sub-project and then switch to the second one, i'd like the second to have the same information in the text boxes as the first one and then simply change the ones that are different.

This shouldn't be so very difficult, my guess would be to set the Default Value for each text box to the previous value for that same text box within the master project, but I don't know how to do this.

Thanks!!!!!!
Hi, gismar.

You have a good guess concerning DefaultValue property.
Take a look at Repeating values for a field in several records.

Regards,
Fish
Feb 4 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.