Forms :: Check Boxes To Enter And Delete Records?
Jun 24, 2013
I have a form to enter archaeological features in a feature table. Each feature is present in one or more archaeological strata, for which I have a stratum table. There are 41 strata in total named 1A, 1B, 2A etc. On the form I want a checkbox for each of these and then to make it add a record to the stratum table for each of the selected strata. The stratum table and feature table are connected by the feature_primary_ID (key in feature table), so when making a new record I need this primary ID and the respective strata to be entered in the fields.
At the moment I've got something like this:
Code:
Private Sub Check1_Click()
If Check1.Value = True Then
DoCmd.RunSQL "INSERT INTO tbl_FEAT_STRAT (feature_primary_ID, stratum_ID) VALUES ((feature_primary_ID of present record),Label2.Caption)"
Else
DoCmd.RunSQL "DELETE FROM tbl_FEAT_STRAT WHERE feature_primary_ID = (feature_primary_ID of present record)"
End If
End Sub
For starters, I dont know how to get the feature_primary_ID from the features table (also represented in the form as a field) and use it to make a new record in the strata table.
Second, when using this code I need a copy for each of the 41 strata checkboxes. Creating lots of redundant code. Easier would be a generic code that loops through all the checkboxes after they've been checked and then add new records for each of the checked boxes. Tried something with a command button, but couldn't get it to work.
View Replies
ADVERTISEMENT
Mar 1, 2015
I have a parent form and connected to it is a subform. On the parent form I have a checkbox which enables and disables fields on the parent form and also hides the subform.
What I want to do is when the user unchecks the checkbox, this action also deletes the associated subform records, if there are any.I'm sure that this can be done with an SQL Delete query in VBA.
View 5 Replies
View Related
Jun 5, 2014
I am trying to make a search option in my form header. Right now I have two unbound combo boxes (CboAccountsfilter and cboCourseName) that I can use to filter my records. Currently, I can use the drop down for CboAccountsfilter and a list of accounts will appear. When I select one, the corresponding Course Names will appear in cboCourseName. This works fine...Code below. I would like to take the filtering a step farther and add checkboxes to filter the data. I my form, there currently exist several check boxes (yes/no)...(Priority, Rep Top Target, Manager Top Target, ect). I would like to have the option to use a check box to filter. I.E if I had a checkbox in my header called PriorityFilter, if checked it would only bring up those records that met the two combo boxes criteria and was a priority.
Below is the code I have so far...it doesnt have anything for the checkbox because I am at a lost of how to get started.
Private Sub CboAccountsfilter_Change()
Me.Requery
Me.cboCourseName.Requery
Me.Check178.Requery
End Sub
[code]...
View 1 Replies
View Related
Jan 3, 2013
I have a table of data regarding companies (contact info, etc). The company I work for provides these companies with up to 10 different products. On my input form, I have created 10 check boxes (and thus, 10 columns of Yes/No data in the corresponding table).
Each company has at least 1 product checked off, and up to all 10.
I would like to create a combo box that lists all 10 products, and upon selecting one, a list box then populates with the names of the companies (primary key) that use that specific product.
So, for example,
Company A buys CATS and DOGS from us
Company B buys DOGS
Company C buys CATS and ELEPHANTS
Combo box options: CATS, DOGS, ELEPHANTS
If I choose DOGS, then a list box gets populated with:
Company A
Company B
and when I click either of these, the record should be brought up for the respective company.
All of this should take place in the header of the form, while the form itself can be updated based on search selections.
View 3 Replies
View Related
Jun 30, 2014
I'm unsure of the best approach for this. I have 4 check boxes to verify. Only 1 of them can be checked, the others need to be disabled. But the user must check one of them.
their control sources are:
admn
sprvsr
data
reado
View 3 Replies
View Related
Nov 18, 2013
I have a form that has three checkboxes (IDDocument, DrivingLicence and Certification) on it. What the form is looking to do is based on the selection it will open a scanned document of the requested documents. There are 5 permutations that could be selected (either first on only, second one only, third one only, first and second and first and third). How do I code the IF Statement this so that the system will look at the different options and then do certain things accordingly.The code I have at the moment is:
Public Sub ProcessRequest_Click()
Dim Form1 As String
Dim Form2 As String
Path = "Staff" & Me!EmployeeName & ""
If Me!IDDocument = True And Me!DrivingLicence = False And Me!Certification = False Then
Do one thing
ElseIf Me!IDDocument = False And Me!DrivingLicence = True And Me!Certification = False Then
Do a second thing
ElseIf Me!IDDocument = False And Me!DrivingLicence = False And Me!Certification = True Then
Do a thrid thing
ElseIf Me!IDDocument = True And Me!DrivingLicence = True And Me!Certification = False Then
Do a forth thing
ElseIf Me!IDDocument = True And Me!DrivingLicence = False And Me!Certification = True Then
Do a final thing
End If
End Sub
All the bits work (the form stuff) but my IF statements are not working. It seems that access is seeing the checkboxes as null and so the IF is not working when i check box 1 and leave the other two unchecked.
View 1 Replies
View Related
Jun 20, 2013
I need to make a form that lists 120 checkboxes and then adds an associated value to get a total.I have a table with Description field (i.e. aspirin) and a Points field (i.e.2). I need to make a subform that shows 120 checkboxes and when the user checks the boxes the associated points are totaled.
I have tried using a default value for each checkbox which works except I can't get the subform to add a new record when I move to the next mainform record.how to make a form where I can see all 120 items and give the use a choice to check 1 or all of them and get a total?
View 5 Replies
View Related
Sep 15, 2014
I have a form named Member, this form has field named hobbies, this field has multiple values selection i.e. a user could select football, cricket, listening to music and etc. these values are stored in another table and i have looked up the values in my form named member, i know access has multiple value option in combo box while we look up values from another table, but i don't want that the check boxes appear in combo box, they should be listed right in form so that i can see them without going inside the combo box and at the same time the values of these populated check boxes should be stored in a single field.
View 14 Replies
View Related
May 12, 2015
I have a basic form that includes check boxes. All works well. But on my (Windows 8) machine, the check boxes display as big ugly black squares. If I open the db from any another machine (Windows 7), check boxes display as I'm used to with a nice outline and bluey tinge to the middle if not set! All machines have Access 2013 on them.
View 6 Replies
View Related
Jun 17, 2015
im trying to enable/disable checkboxes based on a combobox selection for instance,
i make the selection in a combo box called terms and conditions. i want it then to only enable the business,domestic and summary check boxes for that type, with the onther check boxes staying disabled. is there a way this can be done through code like the statement "only enable if this letter type selection has been selected"
View 14 Replies
View Related
Nov 1, 2013
We use access to enter our service tickets in at work.What we have are three date fields.
Call Date
Start Date
End Date
We are 24/7 operation.Currently all 3 just autopopulate with the current date.What i would like to do is ADD a CHECKBOX next to each Date Field.And make it work like this.
1. let them autopopulate as they are currently
2. if you end the call AFTER MIDNIGHT (the next day). CHECKING the box would automatically populate yesterdays date in each of the fields that has the check box CHECKED
View 3 Replies
View Related
Mar 25, 2013
Attached I have a database that I've been working on which has a form called "frmCriteriaSearch". It is based off of the qryCriteriaListBoxUpdate query. I am trying to get the listbox in the second tab of the results section to work. It queries fine for the checkboxes, but I cannot get the comboboxes to affect the query (unless a checkbox has already been selected)
View 6 Replies
View Related
Apr 17, 2013
I work for a foundry and we bring in lots of raw material for conversion to alloy. Each incoming lot is assigned a number on arrival and is then broken down and processed in batches, typically 9. Each of these batches is then assigned a number as well, again a consecutive number which also includes a letter (the letter designates the product). Process data for each batch is kept and final QC analysis data is also recorded.
My question is: how do I set up a form on which I input the lot number, customer, and source once but that fills in that info for each row in the table with which the form is associated? After conversion, I would like to be able to analyze the process data by one of those 3 values so I need them filled in in the table (I plan to pull the data from the Access table into Minitab for statistical analysis).
View 5 Replies
View Related
Mar 28, 2013
I have a main form with a sub form.
I cannot enter new records into the sub form! Only existing records are displayed.
If I open the record source of the sub form, I can enter new records
The subform's Allow additions, deletions & Edits are all "Yes"
View 4 Replies
View Related
Jul 29, 2014
I'm working on a database that tracks students and grades. I have a tblStudents with Personal details, tblStudentsAndClasses which allows me to have a one-to-many to many-to-one relationship, tblClasses with all the class info, plus a tblGPA.
I'm wanting to list all the Student's names listed with their current class and have blanks for data entry for Grade, Grade status, and have a current timestamp in another field. So the teacher can enter the Grades and Grade Status for all students on one day in a single form (think EXCEL). The way I have it now, is that (x number) grades that have already been entered shows up as (x number) copies of the same student. So my relationships are probably set up incorrectly also.
I can't filter out IS NOT NULL because I wouldn't get any students with grades already entered in.
I've found a post on another bytes.com that is REALLY close to what I am looking for, but I don't know anything about VB to be able to adjust it to fit my requirements. I would have tried to do a forum search here, but I'm not sure what terminology I would search for.
View 1 Replies
View Related
May 12, 2015
I am attempting to setup a database and need setting up a form that captures/enters multiple records from one form.
We have batches of case files consisting of 25 folders each. I would like to setup the form where the user only has to enter the [User], [FileGroupID], [Examiner] and [DateAssigned] just once, but also allow for the individual 25 case file numbers in that batch to be entered. (See attached image)
So far I have created 2 tables; BatchLog table which would capture the batch details that is entered once and a CaseFiles table which would capture the individual case file numbers.
View 11 Replies
View Related
Jun 18, 2015
I have a form that when the end user is searching for previous records it creates an erroneous record based off of the search criteria. I want it to create a record ONLY when the "Enter" button is pressed.
Is there a way to limit the form to creating records only when ENTER is clicked on?
View 14 Replies
View Related
Jun 27, 2013
Including check boxes (representing the query fields) in an interactive access form, in order to decide which fields should be visible.
I think the solution is building an invent in VBA for each check box, however I'm not an expert in Access VBA and don't know how to write the code.
In the example that I've uploaded, in the Form1, when I run the query, all fields are displayed, i.e. VENDOR, REGION, CUSTOMER and MATERIAL are displayed. How can I manage it in the form with a listbox to display only the REGION or MATERIAL for instance.
View 4 Replies
View Related
Apr 24, 2008
Hi,
I added some new controls into existing form. I made sure I added those new control names to Table source as well. For some reason, I dont get the values either in the form or in table. Please help. Thanks.
By the way, how can I attach an attachment in this forum. This if first time for me in this forum.
View 4 Replies
View Related
Aug 8, 2013
I have two fields on the main form and I need a total count of records between the value of the two and then enter the total in a bound field on the main form
View 1 Replies
View Related
Apr 26, 2014
I have an Equipment Form with a Supplier subform. The Supplier subform also has a subform, Equipment Pricing Records.
I have the ability to change the Supplier via a combo box, but Equipment Pricing Records become orphaned.
What I would like to do is when a Supplier is about to be changed, for the user to have the option to either a) delete the sub records, or b) the sub records to move across to the new Supplier.
I know I will need to use the after update event once the delete or move decision is made, but I can�t think how to identify the records and then either delete or move them to the new Supplier ID.
The EquipmentID will never change.
Fields are;
EQUIPMENT form;
EquipmentID
SUPPLIER form;
SupplierID
EquipmentIDFK
PRICING RECORD form;
PricingRecordID
SupplierIDFK
EquipmentIDFK
View 14 Replies
View Related
Dec 4, 2014
How can I make certain my user enters records on a subform before attempting to save the main form? Right now they can completely ignore the subform before saving the record.The Main form has business address, etc. on it. the subform is bound to a join table that lists the multiple categories, subcategories and sector the business is listed in for a directory.
I already have my fields set to required at the table level in the join table, and have some existing VBA in both my subform (to update edited date) and my form (to validate empty records where a certain condition is met) but that's not the issue...
How do I focus the user to enter a record on the subform to the point where they are forced to enter something and complete the subform before the record is updated.
View 2 Replies
View Related
Jun 9, 2005
I have a form with a check box among other itmes. What I want to happen is, when the user checks the check box, I want the text box to the right of it to be made visible and to let the user write text. But I only want this text box to be visible when the check box is checked. The check box is if the user wish to put a comment in the form, he will click the check box and then I want my text box to appear so that he may write the comment in the text box. Please help with this. Thanks
View 3 Replies
View Related
Sep 7, 2013
I am building a tool rental data base.I have places a delete button on my Transfer form so the operator can erase any mistake that he/she just made on a Transfer ticket.When I push the button I get an error message saying that I can't delete the record because it is associated with 2 tables. I have one table the tracks the transfer and another that tracks the tools associated with the transfer.How can I delete the transfer and the associated tools records?
View 2 Replies
View Related
Aug 8, 2013
I have a columnar form with a sub-form based on an updatable query. I've created a delete button on the master form with the intention that if the user hits the delete button, it will delete the current record (like its supposed to, right?).
But what is happening is when the delete button is hit, it is asking twice for deletion confirmation and deleting the current record AND the next record. Even if I hit "Cancel" to stop the deletion, it still deletes the current and next records.
Each record has a primary unique ID that is included on the form (but not tab stopped - if that makes any difference), but it doesn't seem to be using that as the basis for deleting.
I've tried two different codes for this:
Private Sub Command110_Click()
On Error GoTo Err_Command110_Click
DoCmd.RunCommand acCmdDeleteRecord
Exit_Command110_Click:
[Code] .....
View 3 Replies
View Related
Nov 23, 2013
I have a form Delete which contains four fields i.e. Date, City, Depots and Vendor, which has combobox.
I am trying to delete a record from table "Sheet1" based on the combobox, for which i have written the following code, but getting an error at the lines highlighted in red :
Private Sub Command30_Click()
On Error GoTo Err_delete_Click
Dim stDocName As String
Dim intResponse As Integer
intResponse = MsgBox("Are you sure you want to delete this record?", vbYesNo + vbExclamation, "Cash Management Team")
Select Case intResponse
Case vbYes
CurrentDb.Execute _
[Code]...
View 9 Replies
View Related