Solved How do I move to a new record automatically in a subform

bmaccess

Member
Local time
Yesterday, 17:30
Joined
Mar 4, 2016
Messages
78
Hi there.

My records are filled from my combobox. The problem I am having is when I try to add the next record from my combobox it overwrites the first record in my subform. I must physically click on the asterisk(*) which is the next record to have a new record added. Any help please.

I have tried this but it is not working.

Me![frmStudentBooksSubform].SetFocus
DoCmd.GoToRecord , , acNext <------- this give me an error


1698946999608.png
 

Attachments

  • 1698946637802.png
    1698946637802.png
    25 KB · Views: 81
It sounds like the combo box is bound to the field in the table. "Searching combo boxes", or those used to select a record, should be unbound.

Is that your problem here?
 
Code:
With Me.frmStudentBooksSubform.Form
   .Recordset.AddNew
   .txtFieldX = Me.cboSomething
   ' do more
End With
 
It sounds like the combo box is bound to the field in the table. "Searching combo boxes", or those used to select a record, should be unbound.

Is that your problem here?
Hi there

I am trying to accomplish the following. But everytime I must first go to the subform click on the empty row below before I can add a record from the combobox.
1698948916684.png
 
All I need is some code to to activate the the row with the asterisk(*).
 
I see. You want to add a record in a different table, one bound to the subform.
Why not put the combo box IN the subform instead of on the parent form? You'd have to change the subform from datasheet to continuous form view and design it to closely resemble the current datasheet, the task would be much more straightforward. There's no real value that I can see to keeping the combo box on the main form when it's intended only to manage the subform.
 
Me!cmbBookNoTitle.Value = ""

Me.frmStudentBooksSubform.Form.Recordset.AddNew

Getting an AddNew Error
 
The problem is I do not want to go and click on the asterisk(*) and then go back to the combobox to go select the item.
I want to select the items from the combobox quickly without going to the asterisk(*) on the subform and it must be added to the subform one after each other

Thanks for those trying to assist and helping me.
 
Check the ribbon setting File >> Options >> Client Settings and check the settings for Editing, which control whether you navigate to a new field or a new record when you hit the tab key. Play with those settings.
 
Hello all. I think my problem looks like it is not understood properly so I simplify it. What code must I add to the button ADD NEW, which is on the parent form to got to a new new record in the subform please. This should be very easy for you guys. So I want the BLUE LINE current record to goto the line where the asterisk(*) the new record. Thanks
1699007155594.png
 
Hello all. I think my problem looks like it is not understood properly so I simplify it. What code must I add to the button ADD NEW, which is on the parent form to got to a new new record in the subform please. This should be very easy for you guys. So I want the BLUE LINE current record to goto the line where the asterisk(*) the new record. Thanks
View attachment 110742
Have you EVEN tried what was suggested in post #3?
 
Hi there. I tried post #3 code in the ADD NEW button but the current focus does not go to the asterisk(*) for new record.
Tried setting focus to the subform?
 
Hi all. I want nothing to be added to the new record. I have code that will add the data in the new record. All I require is that the new record in the subform must get the focus and ready to accept the data. I hope this may help. Any suggestions. Thanks.
 
If
Tried setting focus to the subform?
If I set the focus for the subform I think the first record will get the focus and not the new record Is this correct or is there a way for the new record to get the focus.
 

Users who are viewing this thread

Back
Top Bottom