473,396 Members | 2,147 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.

Data Entry mulitple entries problem

I have a main form and data entry subform. When the main form is selected, the user can view records that exist in the main table in order to determine if they want to complete a data entry form or head over to the update form. The data entry form uses unbound for comboboxes because they need to select from other tables where they can see all items. I have a total of 12 comboboxes that pull data from 12 various tables. Then I have the hidden _id fields from my main table. My database is normalized and the 12 tables that have a relationship to the main have data that will never be update or altered in anyway. Only the main table is altered and an example is I have a state table that lists all 2 letter codes for states and the primary key is st_id which is in the main table. The end user can see the 2 letter state codes because of the rowsource I have. My form record source is a query that has all the relationships so only the _id fields are updated in the main table. Now, some have said bound is best, but when dealing with multiple relationships like this, and the users needing options to select items from other tables, then those have to be unbound.

My problem here is I want to add a button so when the user clicks add, it will add the record but not clear what they entered because they might need to enter the same information and only change 1 item. For example they entered all the data and selected CA for ST_CD and now want to enter all the same data but for NY. When they add right now it clears all fields and they have to select again and I don't want that. Or they don't want that.

The other issue is a button to clear their selection IF they need to enter complete new records

Right now I just have a reset button and say make everything null
Jun 12 '14 #1
1 1133
twinnyfo
3,653 Expert Mod 2GB
Tina,

I think we may need a little better explanation. If there are relationships between the Main Table and the 12 other Tables, I'm not sure I understand why the controls are all unbound.

However, based on your description of "how" you want users to be able to enter data, that would justify an unbound control. If htis is the case, the user enters all their data and clicks "Add" and those entries are copied into the Main Table.

I think I understand...please correct me.

If this is the case, then your answer is pretty simple (if the subform is NOT in a Parent-Child relationship with the Main form AND you have unbound controls.

Here is a starting point:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdAdd_Click()
  2.     Dim db As Database
  3.     Dim rst As Recordset
  4.     Dim strSQL As String
  5.     Set db = CurrentDb()
  6.     strSQL = "SELECT * FROM tblMain;"
  7.     Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
  8.     If Not rst.EOF Then
  9.         With rst
  10.             .AddNew
  11.             !Field1 = Me.cboField1
  12.             !Field2 = Me.cboField2
  13.             !Field3 = Me.cboField3
  14.             ...
  15.             .Update
  16.         End With
  17.     End If
  18.     rst.Close
  19.     db.Close
  20.     Set rst = Nothing
  21.     Set db = Nothing
  22. End Sub
This should update your Main Table, but not clear anything on the subform.

The other issue of clearing all the combo boxes would be similar, but the code would just set each combo box to "" or null.

Let me know if this hepps to get you on the right track!
Jun 12 '14 #2

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

Similar topics

3
by: | last post by:
Hi, I am an intermediate computer science student and I am in need of a "macro type" tool/language that will let me automate a data entry process. The data entry is rather simple but requires...
3
by: JC Mugs | last post by:
I need help with a project, that has two things driving me crazy. 1. I have number entries that wish to have the data enter from the right, so that when you type in 80, it is .80 or eighty...
5
by: Nancy | last post by:
I have two tables: TblCourse CourseID CourseName TblClass ClassID CourseID ClassDate
0
by: tamilan71 | last post by:
Can anyone tell me a simple method of creating an application in Access 2003 that uses "Double data entry"? For me double data entry is defined as the ability to have data entered twice. The first...
0
by: bpo_ccs | last post by:
We are into BPO and Software development business for past six and half years. We are looking for the following any kind of business from your end. Back Office Process Data Entry, Large Volume...
0
by: Andrew Denham | last post by:
Hi, I am a relative VB novice trying to talk to a microcontroller devlopment kit from VB express. I am using serialcommchat - a simple serial port RS232 program that works very well. It can be...
4
by: JohnnyMid | last post by:
I am working on a database, and have been having some trouble with the auto number feature. Occasionally, the data entry form is saving blank records into the table. I am trying to figure out a way...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
8
by: dillneus | last post by:
hey I am quite beginner in Access. I have a problem with data entry form. In a form I want to put one question which will allow mulitple answer. I want to store this anwers in one column. ...
11
by: Ron Morris | last post by:
I have one field query set up for data entry using access 2010. I use this same technique for three separate fiels value entries and it works fine. I would prefer to use one Codenum entry to control...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.