473,685 Members | 2,631 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,STEPD ES,CBOANSWER) into the fields
(CASECODE,STEPD ES,ANSWER) of a subform on the page.

Private Sub cmdANSWER_Click ()
Forms!FRMMENU1! FRMANSWERSsubfo rm![CASECODE] = Forms!FRMMENU1!
[CASECODE]
Forms!FRMMENU1! FRMANSWERSsubfo rm![STEPDES] = Me![STEPDES]
Forms!FRMMENU1! FRMANSWERSsubfo rm![ANSWER] = Me![CBOANSWER]
End Sub
After this is done i would like it to automatically advance the
subform (FRMANSWERSSUBF ROM) 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 4332
ga*****@yahoo.c om wrote:
Hello,

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

Private Sub cmdANSWER_Click ()
Forms!FRMMENU1! FRMANSWERSsubfo rm![CASECODE] = Forms!FRMMENU1!
[CASECODE]
Forms!FRMMENU1! FRMANSWERSsubfo rm![STEPDES] = Me![STEPDES]
Forms!FRMMENU1! FRMANSWERSsubfo rm![ANSWER] = Me![CBOANSWER]
End Sub
After this is done i would like it to automatically advance the
subform (FRMANSWERSSUBF ROM) 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_AfterUpdat e()
If blnNew Then DoCmd.GoToRecor d acActiveDataObj ect, , acNewRec
End Sub
Private Sub Form_BeforeUpda te(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_Ent er()
If Not Me.SubformName. Form.NewRecord Then
DoCmd.RunComman d acCmdRecordsGoT oNew
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
2263
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 items from the database. I then get a count of the return, which correctly tells me that I've got 3 items. I then go into a for loop which I expect to loop 3 times and print out the 3 items. Here is where things get strange: it loops 3 times and...
1
2539
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 Name, PO, Due Date, Received, etc.) 2 questions: 1. I have a button to create a new record on my switchboard, but what I would like that button to do is create a new record but enter in the next job number. Our job numbers are 'H1001', so I...
2
1476
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, only two or three fields change from one new record to another. If I could create a new record out of the same data and then edit the two or three fields, it would save a lot of data entry time. Thanks! Cassandra
7
8858
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 want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
3
1419
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 to the start time on the next record)as well as employee name etc: any ideas?? -- Message posted via http://www.accessmonster.com
0
1676
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 record and display one record at a time. I am accessing the database. Right now it is MS access but will move it to the SQL sever. I am not too sure how to design the web form to accomplish this task. I can do insert, update(edit) and display...
2
13524
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 execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a template file containing the field names Line1 thru Line5 for each record to be printed. If a...
27
3780
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 updates the same data in all other four tables in the right places. I know it would be possible by using the ForeignKeyConstraint object. I have created the tables using the DataSet Visual Tool and I know it doesn't create any ForeignKeyConstraint obj....
4
12433
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
9048
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7591
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6436
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5793
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4303
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2199
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1931
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.