473,732 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening up a form with it going to a new blank entry

12 New Member
I would like appreciate some help on a issue I am having at the moment.

On "Form1" I have a button which opens up "Form2". "Form2" is used to enter in GP data. The issue is that When "Form2" opens, it always goes to the first GP in the table. Is there anyway which I can make it so when "Form2" loads, it automatically goes to create a new blank record instead of going to the first record in the table?

I've posted up the Form_Load code from "Form2". What do I need to change in order for it to automatically go to a new blank entry?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.     Dim rs As DAO.Recordset
  4.  
  5.     Set rs = Me.RecordsetClone
  6.     If IsNull(Forms.Item("Form1").Controls.Item("GPCombo")) Then
  7.         DoCmd.GoToRecord , , acNewRec
  8.     Else
  9.         rs.FindFirst ("GPID=" & Forms.Item("Form1").Controls.Item("GPCombo"))
  10.     End If
  11.  
  12.  
  13.     If rs.RecordCount > 0 Then
  14.         Me.Bookmark = rs.Bookmark
  15.     End If
  16.  
  17. End Sub
Can someone explain and breakdown what the code above does please?

Thank you soooooo much!
Feb 1 '08 #1
1 1347
HotKgon
12 New Member
Ok. I've been searching around and I found out how to make it automatically go to a new record entry.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.         DoCmd.GoToRecord , , acNewRec
  3.     End If
  4. End Sub

Now another question comes about.

How do I make it so if there is already a selection in a combo box on "Form1", that it'll open up "Form2" to modify that GP Details. while if the combo box on "Form1" is empty, it'll go to a new record?

Do I use the IsNull or IsEmpty command for combo boxes?
Feb 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
12479
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this with a query but don't know what the criteria needs to be. Any help would be appreciated, Thanks
2
2252
by: JC Mugs | last post by:
I have a form that when you tab from field to field that the entry point is blank, but if you point and click in the field it brings up a 0 and data entry is started to the left of the zero. Thus if you are click and enter 8 becomes 80, but if you tab to the field and enter 8 it is 8. So my question: is there an easy way to have Access XP-2002 keep the entry on the form blank when you click on a field to enter data?
11
6035
by: Susan Bricker | last post by:
Hi. I am trying to open a form using 'openargs' parameter of the docmd.openform action. The problem is that I would like to pass the form some character (string) and integer data. My plan was to concatenate the data with delimeters (",") between the fields. Then in the Form_Open( ) procedure I would parse the data and fill some "global" variables that could be used to populate some data in the form when there are no records (and I come...
25
10256
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
4
2316
by: Mason | last post by:
This is probably an incredibly newbie-ish question. I just haven't had the cause to use many subforms before, so I'm pretty sure I just don't understand it correctly (even after reading up on it). I have a relationship set up that is used to track the hours an employee has worked on each project during the week. I'm trying to set up a Form to allow someone to choose their name and a Period Ending date (basically, the tblTimeReport...
5
3113
by: Aspnot | last post by:
Background: I have a data entry form that is bound to a DataSet. This DataSet contains 9 tables and the form displays data from each table in textboxes, not a DataGrid. One of the tables in the ParentTable and the rest are children. For Example: The form shows the Customer and their most recently added Contact (in textboxes, not in a DataGrid). When I click the Add button on the form, I enumerate through all of the DataTables in the...
3
3402
by: kartikss | last post by:
I have different form linked with command button, when i go to data entry i get 1st record details avaiable in table. i do not want the data display until i get a command to search a record and only that record to be display in access how do i work on it? Kartik
4
1620
by: oduamy | last post by:
Before I ask my question - I have to say THANKS for all of the wonderful information and help this forum has provided me!!! You are all invaluable. Also, I posted this on the Microsoft forum as well - so if you haunt both, I apologize for the duplication! Here's the problem/question: I can't figure this out for the life of me. I have a form that is built on a basic query (no filters or definitions or parameters) that grabs fields from a...
3
8350
by: Harry2007 | last post by:
How do I get rid of the blank form that attach to the current form when you start to enter data into a continuous form? I want the blank form to only appear after they click on the ADD Record button and not automatically. I have tried to play around with allow addition and data entry and put them in before insert, after insert, on current but yield disappointing result. My initial setting where I set allowedit, addition, deletion and data...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9307
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8186
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...
0
6031
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
4550
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.