Forms :: Inserting New Records With Button In Subform
Jul 25, 2013
I have a database consisting of two tables. One table is meant to be a running log of entries (Table A) and the other is simply used to house specific information relating to certain records (Table B). There is a form within the database that is used for data entry. Within that form there is a subform that has a button that will automatically insert a new record into the running log (Table A). This button currently carries over one value (a Doctor's ID) but I also need this button to begin carrying over my employee's name as well. I have tried numerous times and I can not get this second value to carry over.
View Replies
ADVERTISEMENT
Jun 18, 2014
I have a tabular form with many rows of records. Users add some additional information and now I would like to insert it into a new table.
I tried to use below code and it works but it inserts only first row out of many. So I just wonder how to amend it to insert all data?
Code:
CurrentDb.Execute "INSERT INTO [PO Lines - Table] ([SKU], [SKU Description], [Barcode], [Qty], [Unit Price], [PO Number], [Range])" & _
" VALUES ('" & Me.SKU & "','" & Me.SKU_Description & "',''" & Me.Barcode & "''," & Me.Qty & "," & Me.Unit_Price & ",'" & Me.PONumber & "','" & Me.Range & "')"
View 12 Replies
View Related
May 12, 2014
A message "Microsoft Office Access has stopped working" appears everytime I input something in the Subform [Search] box beside navigation button. After that, the database closes. Attached is the screenshot of my subform.
View 5 Replies
View Related
Sep 7, 2013
My programming abilities are mediocre, but not novice.I have a pretty large scale management system to build (more than 40 tables, lots of relationships, forms, etc). One of the structures in the database is the following:
+ Main table
++ Secondary table connected to Main table via FK1.
+++Tertiary table connected to Secondary table via FK2.
The above when making the user interface is expressed as a form (Main Table), a subform (Secondary table) and a subform within the subform (Tertiary table).
I need to create a button that duplicates the contents of the main table, the secondary table and the tertiary table. I have already been able to create a button that duplicates the contents of the main table and the secondary table by using Allen Browne's code found online.how do I move forward to embedding in that method the ability to duplicate the contents of the Tertiary Table?
View 2 Replies
View Related
Nov 5, 2013
I am designing a database to manage hospital patient data. I will have to enter info at various points, e.g. when a patient is referred, admitted, discharged...
So for example, I have a main form with the patient's name and two subforms, one with the referral details (e.g. date, name of referrer...), and one with the admission details (e.g. date, diagnosis). They are linked through Parent-child links to the main form by PatientID. So, when I enter a new PatientID in the main form, the ID in the subforms is automatically added/synchronized.
However, I would like it not to be...since not all patients that are referred are then admitted. Therefore I would like to have a command button in the main Form that allows me to control when a new patient record is added to the admission subform. In other words, I would like an "Add a new Record in the admissions subform" button, which then creates a new record, with matching PatientID in the admissions subform (and in the related table). Is this possible???
I have tried using the command button wizard but it either requires a record to be already present in the subform, or it takes me to the first record of the form, and not the matching PatientID one.
View 7 Replies
View Related
Aug 30, 2014
I got a problem about form designing. i need to disable my Close Command button while my subform Price cell is null and enable the Delete button.
And while delete button is pressed the delete action occurred and close button enabled.
View 12 Replies
View Related
Mar 3, 2015
I have a subform [ctrlLogDetail] on a parent form [incidentdetails] that is opened by the user when they click on a button on a navigation form. These forms are used for a variety of purposes. The problem I'm having is that the user needs to be able to select an incident number and go to the appropriate form (I accomplish this by using this code: DoCmd.OpenForm "IncidentDetails", acNormal, , "Activity_ID = " & Me.cboINum in the on click event of the button.) This works appropriately. The subform is also appropriately linked to the parent form.
I need an additional line of code to have the subform go to a new record when the form opens to an existing incident number. Since I use this form/subform when doing different tasks, having the Docmd.RunCommand acCmdRecordsGoToNew in the Form on open event isn't optimal.
I only want the LogDetail subform to open to a new record when the user wants to add an entry, but not when they need to edit a specific entry. What is the appropriate syntax to use either in the openargs event of the openform command or elsewhere in the procedure so that the gotonew function on the subform only occurs when this button is clicked? I'm having difficulty getting access to understand that I want the subform to open to a new record but not the parent form.
View 1 Replies
View Related
May 8, 2014
I have two option buttons, 1_optn and 2_optn. I have two subforms, 1_frm and 2_frm.
When clicking the little round dot (the option button) for 1_optn, I want the subform 1_frm to become visible. Likewise, when clicking 2_optn, I want the subform 2_frm to become visible. In the properties panel, both forms visibility is set to No.
I have tried creating a Macro and the best I've gotten is using the OpenForm function but that opens up the forms in a new window. I'd set the Macro to the OnClick event for a combo box (as I couldn't get the option button to work) so when "1" is clicked, the form would pop up. But they have to be in the same form. No pop ups. It also has to be an option button, not a combo box or list box.It also has to be a Macro. No Event Procedure coding unfortunately.
View 1 Replies
View Related
Aug 4, 2005
Ok, I know this is already part of another thread, but my problem is a bit more complex...
The database I've been designing catalogs traffic signal equipment at every intersection in a 12-county area. There's about 480 intersections in the database. My boss pointed out the need to have the intersections listed in geographic order. For example, if I have three intersections on IL Rte. 5 - John Deere Rd, Bauer Parkway, and Industrial Park Rd, they need to be listed in the order in which they exist on the road (from east to west or north to south). Alphabetically, the intersections would be Bauer, Industrial, John Deere. But, as you drive down the road (from east to west), the intersections occur as Industrial, Bauer, and John Deere.
I can sort the intersections according to their "corridors" without any trouble, but I have to force the geographic order of the individual intersections by assigning each an index value (like "1", "2", and "3"). Better yet, I can assign the indices in multiples of 10, 100 or 1000, (1,2,3 becomes 10,20,30 or 100, 200, 300, etc.) and guarantee there will likely always be a sequential position available in the geographic index for a new intersection. Plus, I can always pick the "middle" of the range for each new insertion. For example, if Bauer has a geographic index of 200 and John Deere's is 300, then I can give Zebulon a value of 250 - leaving equal room for insertions before and after Zebulon in the future.
Pulling this off isn't hard - I know how to do it. The problem is running out of positions in the index. In the case of my database, it is unlikely we'll ever add more than two or three intersections between two existing ones, so using multiples 100 is probably best. In this case, I can add at least 6 intersections before I run into the possibility of having two intersections whose indices have a difference of only 1. Using 1000, the value goes up to 9. Each multiple of ten gives you 3 more entries (minimum) before encountering consecutive indices. I guess the inherent problem is figuring out a more "infinite" way of accomplishing this. I don't readily need it, but on the off chance that I do end up with consecutive intersections (that I have to insert between), it'll require manual re-numbering to fix the problem.
That's my solution, but there may be something simpler. Any thoughts?
View 7 Replies
View Related
Mar 17, 2014
I have two command buttons in a subform "sbfScoutRegDetails", one that launches a report and the other attaches the report pdf to an email, associated with the record ID when clicked.
Both of these buttons work fine when just the subform itself is open, but when viewing it in its main form, I get a window saying 'enter parameter value' for "Forms!sbfScoutRegDetails!ID" (this is the WHERE condition in the macro).The report then opens with all the record information blank.The full WHERE condition
Code:
[ID]=[Forms]![sbfScoutRegDetails]![ID]
Not sure if it's because of using a continuous form as a subform? I need the user to be able to view/print or email a contract to each group/contact that signs up.
View 5 Replies
View Related
Jan 12, 2014
Is it possible to clear filters set on a subform using a button on the main form?
View 1 Replies
View Related
Apr 9, 2014
How can I add a new line of record below a previous record after pressing the add button? I have attached a picture of my project.
View 3 Replies
View Related
Sep 22, 2013
I have a form "Handover" on this form I have a button that enables edit functionality once clicked, I now have a subform on this form named "Bdown".
The Bdown subform allows edits without having to click the "btn_Edit" on the main form "Handover".
Is is possible to make the edit button on "Handover" control the edit function on "Bdown" also?
Currently "Handover" contains:
Code:
Private Sub btn_Edit_Click()
Me.AllowEdits = True
Me.btn_Edit.Caption = "Editing"
End Sub
[Code] .....
View 2 Replies
View Related
Jul 1, 2013
What i'm trying to do is add a new record to a subform. The problem is, I couldn't use a subform based on a table in order to achieve this. I needed extended information for it to be useful, so I made the visible part of the subform based on a query instead.I'd like to add a button that adds a new object to the main job. I'd like the adding of that button to call a new form allows you to fill in the information for that object (this called form actually contains 5 subforms to populate all the data of the object). That form works.
What I need is for the button to call the 2nd detailed form AND create the necessary entries in the project/object junction table.The idea as it is now is a button on the main form, but if it was possible to do so via continuous form in a subform, that's doable.
View 11 Replies
View Related
Sep 2, 2014
i have some command button and some combo box on my form and also a subform. the subform contains some field. the fields used to enter numeric values.
i need to disable my command button on the form based on the subform fields if they r null.
View 1 Replies
View Related
Mar 21, 2015
I have two forms one simple and another sub form located in simple form and connected to query where query has parameters, while opening the simple form the sub form require the parameter values. Question is here how I can make the sub form like when I open the simple form the sub form must be disabled (not request me for parameter values) and make a button in simple form to activate the sub form and then request me the parameter values.
View 1 Replies
View Related
Oct 31, 2006
Hi!
Please, please, please help me!
I have created a form that should get Date, Day inputed by a user. Then it must place 8 the same records in the table.
Any help will be appreciated
Thanks in advance
View 2 Replies
View Related
Feb 5, 2008
Hi!
I hope this is the right section for posting this Q.
I use Access 2003 on WinXP pro as front-end & for back-end a MySql on a Linux server. I use MyODBC to connect to the back-end and all the tables are on the back-end. The workstation is connected to the server via VPN (so the server and the station are on different locations).
Quite often I get a problem that not all records are inserted into a table. E.g. I have like 5 - 15 records (up to 10 fields) in one table and I want to transfer/copy them to another:
strSql = "INSERT INTO tblDetailNakup " & _
"SELECT tblDetailNakupTemp.* " & _
"FROM tblDetailNakupTemp;"
docmd.runsql strSql
most of the time it works OK, but from time to time a couple of records are missing.
What could be the problem? Is there any way for somekind of a check, if all has been inserted otherwise the query is repeated?
TNX in advance,
Miha
View 2 Replies
View Related
Aug 31, 2005
Hey guys, got another question for you.
I have a table that has the follow fields (this is for a mailing schedule)
Job Name, Mail Date, Job Number, ID #, Material Due Date, Quantity To Mail
Here's the problem I'm having.
For each "Job" that we have, it can have multiple "Mail Date(s)". I'm trying to create a form that will allow a person to enter one "Job Name" and multiple "Mail Date(s)" and have it create a total number of records based on the number of "Mail Date(s)" (total possible is 4). Example below.
I'm creating a mailing for "Free Hot Coffee", I enter the "Job Name" once, and enter 4 "Mailing Date(s)", then click a button and have Access add 4 records for "Free Hot Coffee" each with a separate "Mail Date"
Is this possible? If so how? I was thinking of using a For loop but didn't know if it was possible.
Thanks in advance.
View 3 Replies
View Related
Jan 19, 2015
Ive created a form and one of the fields is a field called "Due Date"
I want to create a button that once pressed will sort the records in order of due date with the oldest being record 1.
How I can get a button to manipulate fields.
Ive got a set of buttons at the bottom of my form (Ive placed them in the footer) that were set up using Access automatically. They go to first, last, next and previous records. Ive also set up two extra, one that creates a new record and another that sets the record.
The thing is that the set record button I would actually like it to take the data in a field called "Frequency", add a random number to it and then set the record.
View 1 Replies
View Related
Jan 28, 2006
Hi all,
Really, I am very happy to be a member in this great forum with those great members....
I have a form with three text boxes and one button "Submit". This form is build based on a table with three columns. How can I insert records into this table through that form by clicking that button "Submit"....
Thank u and sorry 4 bothering u....
View 7 Replies
View Related
Aug 1, 2006
Hi all,
Really, I am very happy to be a member in this great forum with those great members....
I have a form with two text boxes and one button "Submit". And also, I have a table with two columns. How can I insert records into this table through that form by clicking that button "Submit"....
I think it is simple, but I am very beginner in Access....
See the attached file....
Thank u and sorry 4 bothering u....
View 6 Replies
View Related
Jan 31, 2008
hi all,
I have created the database with multiple tables. I've created one main table to store all records from other tables. Then I have make several forms to enter record into several tables.
What I'd like to make is that when I enter new record to any one of those other tables, then it will be automitically add to the main table also. The record no of main table will be automatically increase by itself when the new record came in.
Can anyone help me with it?
thanks.
View 8 Replies
View Related
Mar 4, 2015
How does one get multiple records inserted into a table at once, when you press the "Add Record" button? Resulting in the table below:
MAKE
MODEL
GAS / ELECTRIC
COUNT
YES / NO
Honda
Accord
Electric
1
YES
Honda
Accord
Gas
3
YES
Honda
Civic
Gas
0
NO
Ford
Mustang
Gas
4
YES
This is how it must be setup, all I need is to know how.
View 5 Replies
View Related
Jul 3, 2014
I have a form listing out a bunch of clients. There is a button associated with each client that pulls open a new form with additional client information. There is information that is calculated on the backend and stored in the database when a user is inserted or different fields updated (i.e. there are reports that are due different time frames after the clients admission date. I automatically populate the database with those dates once the clients admission date is updated).
The problem I am having is that when I enter a new client or update a current client with new information and then click the button to go to their details page, those auto-populated dates are not populated. I am calling a subroutine that is within a module when the button is clicked. The subroutine works fine at other instances throughout the application so I know there is no issue with the code. I even call it if they click the close button, but before the information is auto-populated, I had to run a Me.Requery on the close button. I think this is because the records are not actually being updated in the database. I even have a DoCmd.Save acForms, "Clients" command before running the Call updateDatabase subroutine, but that doesn't do the trick. I can't run the Me.Requery after the click of the details button because when I do that it always opens the details form to the first ORDER BY record. I think that I need to update the selected record and re-call it in order for this to work.
View 5 Replies
View Related
Oct 21, 2014
I know all of the main features and can even do a bit with macros and VBA. I need creating a button to auto-fill a field in all the records in a table.
I have a database centered around a table called tblCand; each record contains a date field called intDate. On the main form, initDash, when the user hits a certain button, a window pops up (either a message box or perhaps a separate form) that asks the user to type in a date, which would be stored as intDateDB. When the user hits OK, I want the value of intDateDB to replace the value of intDate in all the records in tblCand.
I'm not sure whether this is called auto-filling or auto-populating...
View 11 Replies
View Related