If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
Is it possible to have the subform on a main form open in add mode
while the main form is in edit mode? I have a main form that shows the first and last name of my drivers while the subform is for entering a date and number of hours on duty for that date. The subform is beginning to have a large number of entries and I have to scroll down to the last entry to begin entering data. Thanks for your help Justin |
#2
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
Yes, just set the subform's Data entry property to Yes.
This sort of thing you can just try for yourself by changing the setting to the one you want. Then test the form/subform to see if it works the way you want. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Justin" wrote in message ... Is it possible to have the subform on a main form open in add mode while the main form is in edit mode? I have a main form that shows the first and last name of my drivers while the subform is for entering a date and number of hours on duty for that date. The subform is beginning to have a large number of entries and I have to scroll down to the last entry to begin entering data. Thanks for your help Justin |
#3
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Wed, 3 Feb 2010 12:07:30 -0800 (PST), Justin wrote:
Is it possible to have the subform on a main form open in add mode while the main form is in edit mode? I have a main form that shows the first and last name of my drivers while the subform is for entering a date and number of hours on duty for that date. The subform is beginning to have a large number of entries and I have to scroll down to the last entry to begin entering data. Thanks for your help Justin Sure. Jeanette's suggestion of "Data Entry" will work. However, it has the disadvantage that if Data Entry is set to Yes, then that's ALL you can do - add new records - and you won't see any existing ones. As an alternative, you can use the Load event of the subform to jump to the new record: Private Sub Form_Load() DoCmd.GoToRecord, , acNewRecord End Sub -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Feb 3, 6:36*pm, John W. Vinson
wrote: On Wed, 3 Feb 2010 12:07:30 -0800 (PST), Justin wrote: Is it possible to have the subform on a main form open in add mode while the main form is in edit mode? I have a main form that shows the first and last name of my drivers while the subform is for entering a date and number of hours on duty for that date. The subform is beginning to have a large number of entries and I have to scroll down to the last entry to begin entering data. Thanks for your help Justin Sure. Jeanette's suggestion of "Data Entry" will work. However, it has the disadvantage that if Data Entry is set to Yes, then that's ALL you can do - add new records - and you won't see any existing ones. As an alternative, you can use the Load event of the subform to jump to the new record: Private Sub Form_Load() DoCmd.GoToRecord, , acNewRecord End Sub -- * * * * * * *John W. Vinson [MVP] Your method is what I was shooting for John. I had looked at Jeanette's method before, but wasn't sure that it was what I really wanted. Thanks to the both of you for helping to educate another novice. Justin |
#5
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Feb 4, 7:45*am, Justin wrote:
On Feb 3, 6:36*pm, John W. Vinson wrote: On Wed, 3 Feb 2010 12:07:30 -0800 (PST), Justin wrote: Is it possible to have the subform on a main form open in add mode while the main form is in edit mode? I have a main form that shows the first and last name of my drivers while the subform is for entering a date and number of hours on duty for that date. The subform is beginning to have a large number of entries and I have to scroll down to the last entry to begin entering data. Thanks for your help Justin Sure. Jeanette's suggestion of "Data Entry" will work. However, it has the disadvantage that if Data Entry is set to Yes, then that's ALL you can do - add new records - and you won't see any existing ones. As an alternative, you can use the Load event of the subform to jump to the new record: Private Sub Form_Load() DoCmd.GoToRecord, , acNewRecord End Sub -- * * * * * * *John W. Vinson [MVP] Your method is what I was shooting for John. I had looked at Jeanette's method before, but wasn't sure that it was what I really wanted. Thanks to the both of you for helping to educate another novice. Justin Guess I should have tried it before I responded. I put your code in the Load event of the subform and it hangs up. Should this code go into another event in addition to the load event? I copied the code and pasted it into the event and it didn't give an error until I tried to open the main form. The run-time error 2105 comes up saying that "you can't go to the specified record". Thanks again for you help. Justin |
#6
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Thu, 4 Feb 2010 05:49:55 -0800 (PST), Justin wrote:
Guess I should have tried it before I responded. I put your code in the Load event of the subform and it hangs up. Should this code go into another event in addition to the load event? I copied the code and pasted it into the event and it didn't give an error until I tried to open the main form. The run-time error 2105 comes up saying that "you can't go to the specified record". Thanks again for you help. My mistake! I didn't test it myself... that will happen (I'm guessing) if there are no records in the subform at all. Let me think about this and I'll get back to you - or does anyone else have a solution handy? I know this has been done! -- John W. Vinson [MVP] |
#7
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Feb 4, 1:09*pm, John W. Vinson
wrote: On Thu, 4 Feb 2010 05:49:55 -0800 (PST), Justin wrote: Guess I should have tried it before I responded. I put *your code in the Load event of the subform and it hangs up. Should this code go into another event in addition to the load event? I copied the code and pasted it into the event and it didn't give an error until I tried to open the main form. The run-time error 2105 comes up saying that "you can't go to the specified record". Thanks again for you help. My mistake! I didn't test it myself... *that will happen (I'm guessing) if there are no records in the subform at all. Let me think about this and I'll get back to you - or does anyone else have a solution handy? I know this has been done! -- * * * * * * *John W. Vinson [MVP] There are already records in the subform, so I don't think that's it. Until later, thanks. Justin |
#8
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
"John W. Vinson" wrote in message
... On Thu, 4 Feb 2010 05:49:55 -0800 (PST), Justin wrote: Guess I should have tried it before I responded. I put your code in the Load event of the subform and it hangs up. Should this code go into another event in addition to the load event? I copied the code and pasted it into the event and it didn't give an error until I tried to open the main form. The run-time error 2105 comes up saying that "you can't go to the specified record". Thanks again for you help. My mistake! I didn't test it myself... that will happen (I'm guessing) if there are no records in the subform at all. Let me think about this and I'll get back to you - or does anyone else have a solution handy? I know this has been done! Current event of the main form ought to do it. E.g, Private Sub Form_Current() Me.sfSubformName.Form.Recordset.AddNew End Sub (Access 2000 or later) -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#9
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Feb 4, 1:52*pm, "Dirk Goldgar"
wrote: "John W. Vinson" wrote in messagenews:uo2mm5hjvrkl0k3o36b86pd73604jg5k71@4ax .com... On Thu, 4 Feb 2010 05:49:55 -0800 (PST), Justin wrote: Guess I should have tried it before I responded. I put *your code in the Load event of the subform and it hangs up. Should this code go into another event in addition to the load event? I copied the code and pasted it into the event and it didn't give an error until I tried to open the main form. The run-time error 2105 comes up saying that "you can't go to the specified record". Thanks again for you help. My mistake! I didn't test it myself... *that will happen (I'm guessing) if there are no records in the subform at all. Let me think about this and I'll get back to you - or does anyone else have a solution handy? I know this has been done! Current event of the main form ought to do it. *E.g, * * Private Sub Form_Current() * * * * Me.sfSubformName.Form.Recordset.AddNew * * End Sub (Access 2000 or later) -- Dirk Goldgar, MS Access MVP Access tips:www.datagnostics.com/tips.html (please reply to the newsgroup) I placed this line of code in the Form Load and Form Current and it seems to work like I want it to. DoCmd.GoToRecord , , acNewRec Thanks for all the help guys. Maybe one day I can give back to the group as well. Justin Thomas |
#10
|
|||
|
|||
Setting subform to add mode while main form is in edit mode
On Thu, 4 Feb 2010 13:52:33 -0500, "Dirk Goldgar"
wrote: Current event of the main form ought to do it. E.g, Thanks much, Dirk - I was going to test it out that way, but looks like you nailed it! -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|