Hi Pat. Thank you very much. After the changes you suggested the following code WORKS PERFECTLY.
Me.Parent!cmbBookNoTitle.SetFocus
Thanks once again. I appreciate your help. You are Brilliant.
The data from the combobox is stored as a new record on the subform. If there is already that name a duplicate error message appear and I must add a new different book. So I want the setfocus to go back to the combobox to add a different book.
Okay I added code:
If DataErr = 3022 Then...
Hi there. I would like to set the focus on a component cmdBookNoTitle in my main form from an Error Event handler of a subform.
The name of my subform is frmStudentBooksSubform.
The parent form is frmLearnerBaseDetails
The component on the main form is cmdBookNoTitle.
Thanks
Error Event code...
Hi MajP. I would like to thank you for your persistence. It is working now thank you very much. I think one of my fields tabstops was set to no.
But the code you provided works PERFECTLY. You made my day. THANKS FOR NOT GIVING UP ON ME.
Hi MajP. When I saw your first post I thought and I have a feeling you the right guy that going to solve my problem. I knew you have the expertise to help me. Thanks for sticking around I appreciate it. I know others have given up already.
Yes, the record is Stephen Lai is BLUE. Write me code to give me a BLANK NEW RECORD under Stephen Lai and make it BLUE with no data in it thats what I am asking for.
If all fails the user must just click on the asterisk(*) to add a new new. MajP your Add new works, but the new record is not selected or have a blue bar on it to accept data immediately. That is what I want, when you say add new, a new record must be added and the whole record must be selected...
Testing using a scanner my problem is not solve. So I need to find code to solve my original problem again. But I am looking at all of your code to see what works and don't. I am greateful for all your input. Thanks
Hello guys. This was no prank. I am not here to waste your time and my time on pranks. To a certain degree the problem is solved when I am not using a scanner I can click in the combo box. When I tried using the scanning it looks like my problem not completely solve. I have notice on this forum...
Hello guys. Thanks to you all. I have solve my original problem. I do not even need a button to add a new record. Once I added a record I just scroll down when I need to add another record.
Hi MajP. Your code work nicely, But it overwrites my current record. Any suggestions. I will happy if it works. Thanks
Private Sub cmdAddRecord_Click()
frmStudentBooksSubform.SetFocus
With Me.frmStudentBooksSubform.Form.Recordset
.AddNew
.Update
End With...
Hi there. I liked you example. The adding of new records worked nicely. I will try again your example and see if it can work with my original application. I will let you know if I manage to get it going. Your code was the easiest and really liked it. All I need is to just get the new records...
Hi there all. Thank you for all the feedback. My apologies if you feel that I did not give you proper feedback on why the code did not work.
All of your code work if the Add New Record is inside the subform. When the Add New Record button is outside the subform unfortunately the code provided...