473,503 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create/Advance to next record after entry

Hello,

I have a data entry form that has a button to copy the values of
fields (CASECODE,STEPDES,CBOANSWER) into the fields
(CASECODE,STEPDES,ANSWER) of a subform on the page.

Private Sub cmdANSWER_Click()
Forms!FRMMENU1!FRMANSWERSsubform![CASECODE] = Forms!FRMMENU1!
[CASECODE]
Forms!FRMMENU1!FRMANSWERSsubform![STEPDES] = Me![STEPDES]
Forms!FRMMENU1!FRMANSWERSsubform![ANSWER] = Me![CBOANSWER]
End Sub
After this is done i would like it to automatically advance the
subform (FRMANSWERSSUBFROM) to the next record so that I can add
multiple entries into it. Can someone help here?

Also, when the main form loads how do i have the subform startup on a
NEW record?

Thanks for your help! Gavin

Oct 16 '07 #1
2 4323
ga*****@yahoo.com wrote:
Hello,

I have a data entry form that has a button to copy the values of
fields (CASECODE,STEPDES,CBOANSWER) into the fields
(CASECODE,STEPDES,ANSWER) of a subform on the page.

Private Sub cmdANSWER_Click()
Forms!FRMMENU1!FRMANSWERSsubform![CASECODE] = Forms!FRMMENU1!
[CASECODE]
Forms!FRMMENU1!FRMANSWERSsubform![STEPDES] = Me![STEPDES]
Forms!FRMMENU1!FRMANSWERSsubform![ANSWER] = Me![CBOANSWER]
End Sub
After this is done i would like it to automatically advance the
subform (FRMANSWERSSUBFROM) to the next record so that I can add
multiple entries into it. Can someone help here?

Also, when the main form loads how do i have the subform startup on a
NEW record?

Thanks for your help! Gavin
Probably the easiest method, if the folks are filling out the subform,
is to set the Cycle property to AllRecodds under the Other tab in the
property sheet. When they hit the last field, it goes to the next
record. But...

I created a form/subform. The subform has the fields A, B, C and an ID
to link to the main form. The subform has the following code.

Option Compare Database
Option Explicit
Dim blnNew As Boolean
Private Sub Form_AfterUpdate()
If blnNew Then DoCmd.GoToRecord acActiveDataObject, , acNewRec
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
blnNew = (Me.NewRecord)
End Sub
Private Sub Form_Current()
Me.A.SetFocus
End Sub

As for opening to a new record, you can use the OnEnter event in the
Main form. Click on the subform in the main form and pull up the
property sheet. Modify the code to suit your needs
Private Sub SubFormName_Enter()
If Not Me.SubformName.Form.NewRecord Then
DoCmd.RunCommand acCmdRecordsGoToNew
End If
End Sub
Oct 16 '07 #2
thanks salad im going to try this out.

Oct 16 '07 #3

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

Similar topics

2
2254
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
1
2516
by: Tom Cusick | last post by:
We have a Job Shop database. When I get an order in I put all the line item information into the database. Some orders have multiple lines and most of the information is the same. (eg. Customer...
2
1461
by: Cassandra | last post by:
My data entry form has thirty one fields. After I go to a new record and enter all the fields, how can I create another new record out of the same data? Sometimes when I am entering new records,...
7
8821
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
3
1414
by: Jamie Pittman via AccessMonster.com | last post by:
I am currently using a form to track employee time to customer and warehouse. I want to be able to take information from one record and post this to tne next record(finish time on the first record...
0
1668
by: Qajussi | last post by:
Hi! I am trying to create data entry forms like MS access forms using asp.net. I am talking about a form like MS access forms which let you enter a new record, edit, navigate to previous and next...
2
13481
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
27
3740
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
12412
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
0
7202
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
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7332
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...
1
6991
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
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
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,...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.