Forms :: Adding A Record To Table From Input Form
May 29, 2014
I have a table with 2 fields in it - Type and Pallet_Case - using a form the user enters the name of the Type and then from a combo box selects either Pallet or Case. There is a button on the form that is to save the new record to the table. (code below) The strangeness that is happening is that when the new record is added to the table, whatever is the first existing record alphabetically in the table is changed to the same Pallet_Case selection that was made for the new record.
I have a list box that displays on the form that is updated after a new record is added to show what records exist in the table (this is done by a query of the table and sorts on the type), so I can see this happening without having to open the table. It doesn't matter what sort order I put the list box in nor the table it still changes the first record alphabetically. And it is only change the Pallet-Case field. I even changed the first record to something else and it still did this.
Dim dbs As DAO.Database, strSql As String
Set dbs = CurrentDb
strSql = "Insert into [PP Type TBL] ([Prepack Type],[Pallet Case]) Values ('" & Me.Type & "','" & Me.Pallet_Case & "' )"
dbs.Execute strSql, dbFailOnError
View Replies
ADVERTISEMENT
Nov 6, 2013
I have limited experience in Access, but I have managed to create a user form, where items are selected from comboboxes (Test results; when, who, outcome, etc)
At the end I have built in a command button that should add a record to an existing table, but so far no luck. I have used the following VB code for this:
Private Sub Save_test_results_KeyPress(KeyAscii As Integer)
Dim dbsICT_Test_Management As DAO.Database
Dim rstActual_test_results As DAO.Recordset
Set dbsICT_Test_Management = CurrentDb
Set rstActual_test_results = dbsICT_Test_Management.OpenRecordset("Actual_test_ results")
rstActual_test_results.AddNew
rstActual_test_results.Update
End Sub
View 6 Replies
View Related
May 22, 2013
Whenever I add a new record to a table with a form I created, it records the "ID autonumber" that it's associated with instead of the text. For instance, if I selected "Kevin" from a combobox list and had the form record it, it will show up as "1" in the table under the field name "Names".
View 3 Replies
View Related
Sep 23, 2014
I want to add a combo box to a form, where depending on the values entered in the box another combo box would show more values. In other words, if the first combobox had choices of 1, 2, 3 and 4, if 1 was selected the next combo box would have values a, b, c and d. If 2 was selected, it would have values of a, d, e, f and g.
View 2 Replies
View Related
Sep 1, 2014
I'm creating a new database that will require a form to fill in creating new records in different tables.
Am I able to have one form that will input the record to the relevant table, given one combo box?
View 2 Replies
View Related
Jan 5, 2014
I'm trying to build a search form.- Access 2007
I have a table (Table1), contains a 'part' field.
I wan to build a form with a blank text box (txtbx1) where users can enter a part description, this will search records in Table1>part and return a list of parts that match the textbox input.
Here's what I've done -
txtbx1 - property sheet - control source - part
event - on enter - ...
I've built an expression -
[Table1]![part] = [txtbx1]
hoping that this would match records 1n Table1 to txtbx1
View 10 Replies
View Related
Oct 2, 2013
Is it possible to open a form to add a child record related to the highlighted record in the subform?
View 2 Replies
View Related
Sep 15, 2013
We store data for clients which can be found online. Our current method of getting the data so we can analyze it is to copy a table found online and pasting it into excel.
What we want to do is to copy that data into an access table. This equates to inputting multiple records at the same time. There are 5 columns and around 20 rows (records) pasted at the same time. I want to do this in Access, through a form which would them store that data in the appropriate table.
I assume there is an ActiveX control out there which can put a spreadsheet in an access form. Then i could maybe write a VBA procedure to input the data into a table.
View 3 Replies
View Related
May 18, 2015
I have an Access table with records that have a two letter, two number alphanumeric identifier (AA01, AA02 etc)
I am trying to create a form whereby, when the user types in the first two letters, the next sequential number from the table is generated.
The letters can be totally random and selected by the user, but the numbers do need to be sequential.
View 1 Replies
View Related
Mar 28, 2015
I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?
View 1 Replies
View Related
Jan 25, 2015
I am new to Access and I was trying to create database for chemical inventory handling.I have two tables. one of my tables (chemical info) has information on chemical properties. I used "Cas NO" as primary key. I have another fields such as "chemical name", 'product number" and etc.
In Second table (chemical inventory) i have "ID" field as primary key and I used lookup wizard in order to fill "Chemical Name" field. I thought it will be easy to pick up name rather than typing it because the names were complicated.After I created two forms. one form is chemicals info form based on chemical info table and other one is LAb_inventory based on chemical inventory table.
I set up Lab inventory form as main form and Chemicals info form as subform. Linking field is chemical name. So that when I chose chemical name from combo box i can see inventory data in main form and chemical properties information in subform. Now i have two problems..One of them is when I add new record to my subform I cant see this new record in main form. I suppose it is because chemicals names of each form is derived from different tables. furthermore in main form instead of chemicals name i see "my primary key CAS NO".
What i want to achieve is add new record to chemicals info form and fill up all chemical information save and in the main form to add new record choose new chemical name which i just added and fill up inventory information.
View 1 Replies
View Related
Jan 25, 2015
I am new to Access and I was trying to create database for chemical inventory handling...I have two tables. one of my tables (chemical info) has information on chemical properties. I used "Cas NO" as primary key. I have another fields such as "chemical name", 'product number" and etc.
In Second table (chemical inventory) i have "ID" field as primary key and I used lookup wizard in order to fill "Chemical Name" field. I thought it will be easy to pick up name rather than typing it because the names were complicated.After I created two forms. one form is chemicals info form based on chemical info table and other one is LAb_inventory based on chemical inventory table.
I set up Lab inventory form as main form and Chemicals info form as subform. Linking field is chemical name. So that when I chose chemical name from combo box i can see inventory data in main form and chemical properties information in subform. Now i have two problems
One of them is when I add new record to my subform I cant see this new record in main form. I suppose it is because chemicals names of each form is derived from different tables. furthermore in main form instead of chemicals name i see "my primary key CAS NO". What i want to achieve is add new record to chemicals info form and fill up all chemical information save and in the main form to add new record choose new chemical name which i just added and fill up inventory information.
View 6 Replies
View Related
Oct 25, 2013
I'm working on a database that has a subform which pulls its data from a table and I'm trying to use a popup form to enter the data in the sub form. For example the table is called student debts. The form is called student debt. The pop up form is called student debt entry from. I want the inform that's in the student debt entry form to be recorded in the student debt form which is a subform on the main form. I know i have to create a add new records button to do it but not sure of the code.
View 4 Replies
View Related
Nov 26, 2013
I have a form to add a record to a table. How can I give the user a way to close this form without saving the just created record.
I tried
If me.dirty then
DoCmd.RunCommand acCmdDeleteRecord
endif
This works, but gives a messagebox in return to confirm the command, and I don't want that. And I try to avoid sendkeys. I also don't want to change the options of access.
View 2 Replies
View Related
Sep 26, 2014
I am building a database where one Form displays records from 14 different tables. For some reason, when I recently try to add a field on to a form from a new table, the ENTIRE form loses the record source, and every single field that is already on the form gets that green dot in the corner with errors surrounding a record source that cannot be found. What am I doing wrong? Am I exceeding some limitations with forms?
View 4 Replies
View Related
May 27, 2013
I have a form (called Form2) with say 3 text boxes, called txt_Field1, txt_Field2 and txt_Field3.
In txt_Field1 the user specifies the number of records to be added to an existing table. The fields txt_Field2 and txt_Field3 are used to pre-populate the records with default values.
Furthermore, I have set up a table called Table1. It's headers are ID, Strategy, divRate. ID is Autonumber, Strategy is Text, and divRate is Number.
Suppose the user inputs the following on Form2:
txt_Field1 = 3
txt_Field2 = Covered
txt_Field3 = 0.04
How do I programmatically add 3 records (since txt_Field1 = 3) to Table1 such that the table will look like:
ID, Strategy, divRate
1, Covered, 0.04
2, Covered, 0.04
3, Covered, 0.04
View 6 Replies
View Related
Apr 14, 2015
I have a table for all my members, then a table for each class (for attendance purposes) and the class tables are linked to the master via subdatasheets. I also have a form that pulls up all the details of a member and I want to show all the times they've attended class. Is it possible to add the subdata sheets to the form or would I have to add the attendance record as a subform that filters on the person?
View 1 Replies
View Related
Aug 26, 2014
I have a form AddNewEquipment. This is bound to a table, EquipmentDetails.
EquipmentDetails has a Yes/No field, 'ParentChoice'. So when EquipmentDetails.ParentChoice = Yes, I want to open up a new text box, AddNewEquipment.ParentDescr, into which someone can put some text. This text I want to append as a new row in a different table, ParentList.ParentName. (that table also has an autonumber field)
I only want to do the save when I save the whole form.
Is this something like using an On Lost Focus event from the ParentDescr field which only invokes when the overall form save button is clicked? What would I put in the On Lost Focus event.
View 9 Replies
View Related
Nov 15, 2014
I have quite an extensive form linked to a table. When I add new columns to the table I seem to have a problem getting the form to read the data.I have just added a numerical column to the table and added a text box on the form that is bound to it. When I try to pull up the value using VBA it is blank, even though an entry is visible on the form. I have set the text box to general number and the entry shows in the actual table. When typing in the entry into VBA it capitalises where required so it must be registering the table entry. However the value it pulls remains blank.
View 2 Replies
View Related
Nov 6, 2014
I am adding a combo box to a form with data sourced from a table. Everything seems ok but when I select an option from the combo list and move to the next record the selection is repeated there also. How do I get to select a different option in the next record?
View 1 Replies
View Related
Sep 12, 2013
I have an existing Main form that has a sub form that the user uses to enter multiple records into a table....it works fine EXCEPT that I need to make it even easier and more intuitive and add a lot of labels. Basically the user selects items from a drop down list that adds items to a Work Order. I need to add some labels to the form to make it more descriptive for the user.
So, what I want to add multiple records using a single main form.
Is is possible to?:
1. simply turn the subform into a single main form? Can this be done by using a Command button or something similar?
2. copy all of the controls etc from the sub form into a new main form and have it all work nicely?
View 2 Replies
View Related
Sep 22, 2004
PROCESS AS DESIGNED: The user logs in and is given a form displaying existing records that are coded (by userid) for that user to update. From that list, the user selects a record and continues to a second form (the first form closes) which displays all the fields of the selected record which should/can be edited by the user (plus a few non-editable key fields). There is nothing tricky to how the records are selected for display. A simple query behind the first form selects data records using the userID number. The second form does a simple record select using the active record ID number on the first form. Nothing tricky -- no modules just queries, tables, forms and simple macros to string it all together.
The user can open/close these two forms as often as necessary and the record will continue to show up until a value is entered into a "completion date" field. When that field is no longer blank, the record will no longer be displayed for use.
PROBLEM: About 90% of the time, things work as expected. But 10-15% of the time, somewhere between opening the record in the second form and closing the second form, the edited record totally disappears (as if it were never opened, it isn't even system date stamped) and the input information is inserted instead into a brand new record.
Users can sometimes tell when the edit record is dropped during processing, because key fields displaying previously entered data go blank and the displayed recordID (autonumber) is changed. p>
ERROR PATTERN: NONE! It can happen as the edit record is first opening, in the middle of editing the form, or at the end when closing the form. It will happen on a specific PC 2 times in a row and the third time be fine. It has happened at multiple locations but not for all people and not consistently for the same person/same pc. The same record that failed can be re-selected and work just fine the next time.
I cannot reproduce the error myself. I have tested everything I can think of without causing the error. I can lose changes and avoid a system date stamp if I abort my Access sesssion, but that doesn't create/insert a new record with my new input. It just loses everything.
I have wondered if a momentary break in the network/communications could break the connection to the application to just enough that the form remains on the screen, but selected record is discarded. Input into the empty form would/does insert a new record.
I have asked the IT Operations group to investigate if a network/communication problem could be the culprit, but they haven't gotten far on this. I have never seen this happen before and am totally stumped but am desperate to resolve it before user confidence is damaged.
View 1 Replies
View Related
Dec 17, 2014
When I learnt to use vba in excel (to basic level) I was always advised in a userform to validate data at end of record input i.e. when pressing enter and next. Is this true also with access or should i be putting validation rules at the afterupdate stage of a particular control?
View 1 Replies
View Related
Jan 2, 2014
I would like to know what the best way to input a duplicate record is with the exception of 1 field that is used to correspond with the proper parent of the record?
Here is an example of the problem, We receive a letter with pertinent information that corresponds to 30 of our facilities. I would need to enter this 30 times so that when the users of this information run their reports for their facility I can ensure that the letter would be referenced.
View 3 Replies
View Related
May 23, 2015
How to limit input data on the same month for each patient? The field is a data/text box on a subform
I found this code on Form Current Event!:
Code:
Private Sub Form_Current() Dim intMaxNumRecs as Integer
intMaxNumRecs = 5 'Max Number of Records to Allow
If Me.NewRecord Then With Me.RecordsetClone
If .RecordCount > 0 Then .MoveLast: .MoveFirst
If .RecordCount >= intMaxNumRecs Then
MsgBox "Can't add more than " & intMaxNumRecs & " records in the demo database!" .MoveLast Me.Bookmark = .Bookmark
End If End If End With End If End Sub
But I want a monthly limit...
View 1 Replies
View Related
May 5, 2006
I have been editing the service call management database that comes with office XP.
I have a table called "Workorders" with fields:
WorkorderID (primary key)
CustomerID
And another table called "Workorders by Customer" with fields
CustomerID (primary key)
I want to be able to have an input form where I input a workorderID which then opens the "Workorders by customer form" by customerID which relates to the WorkorderID in "Workorders" which is typed in the input box.
Im only a novice and its the code part that im struggling with.
Any help would be great.
View 2 Replies
View Related