473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Reaching a new record in as sub form

Hello,
Here is my problem: i have a form with a sub form (they are linked). When I
open the form, I would like to reach a new record in the sub form, with
macro or VBA. I have found an "home made" solution by using a lot of TAB
sendkeys on the "On open" event. It Works but I guess I could do better.
Thank you.
Nov 18 '05 #1
4 2553
If your subform is bound to the table you wish to add a record to, you
can use Form_frmName.GoToRecord,, acNew to create a new record and set
the subform's focus on it.

Nov 18 '05 #2
If your subform is bound to the table you wish to add a record to, you
can use Form_frmName.GoToRecord,, acNew to create a new record and set
the subform's focus on it.

Nov 18 '05 #3
Thank you Steve, I will try.
"Steve" <th*********@gmail.com> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...
If your subform is bound to the table you wish to add a record to, you
can use Form_frmName.GoToRecord,, acNew to create a new record and set
the subform's focus on it.

Nov 19 '05 #4
Steve,

I tried but dis not succeed ! I tried your code and at last the following.

Here is the code I made for the "on opening" event of the form, SF is the
name of the control containing the subform called SForm (the subform is
bound to a table)

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord acDataForm, "SForm", acNew
End Sub
I tried differents solutions not very different of this one but most often
the message says something like "The form is not open, so it is impossible
to do anything"

What is wrong ?
"F6GGR" <no****@wanadoo.fr> a écrit dans le message de news:
43***********************@news.wanadoo.fr...
Thank you Steve, I will try.
"Steve" <th*********@gmail.com> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...
If your subform is bound to the table you wish to add a record to, you
can use Form_frmName.GoToRecord,, acNew to create a new record and set
the subform's focus on it.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
8
by: Zlatko Matiæ | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
2
by: suneet.taparia | last post by:
Hi, On IE7 I'm using a script: function saveValues() { var validateOK=true; if (typeof validate !='undefined') validateOK = validate(document.EditForm);
7
by: newbie | last post by:
hi, I have the following construct: public class Form1:System.Windows.Forms.Form { ..... ----a TextBox is created by the Designer in this area: 'textBox1' ..... }
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
3
prn
by: prn | last post by:
Hi folks, I've got something that's driving me crazy here. If you don't want to read a long explanation, this is not the post for you. My problematic Access app is a DB for keeping track of...
2
by: MLH | last post by:
I have an A97 form with Allow Edits, Allow Deletions and Allow Additions properties set. Scrolling through records will eventually take me to the end of the records and one more PgDn will take me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.