Setting Default Values In Combo Box To Match The Value Of Previous Record
Dec 21, 2005
G'day. I've been browsing the forum trying to find a solution to a problem, without much luck, and am hoping that someone might be kind enough to help me more directly.
I'm a biologist and a newbie to access: with the distinction of being completely clueless about VBA. Nonetheless, I have been tasked with creating a database for storing data obtained from biological surveys of juvenile salmon and harvest/spawner surveys of adult salmon.
The bones of the db are in place and functional. The problem I have is streamlining the data entry process to minimise keystrokes/mouse clicks.
I have a subform for entering fish records with attributes such as 'species_name', 'fork_length', 'count', 'presence of tags, etc. The idea is that fish can be entered as individuals (count=1) or groups (count>1) with attribute data at the appropriate level (eg, fork lengths only entered for individuals. We typically measure the fork lengths of the first 20 individuals of each species and then tally the remainder).
One problem I face is that fish often occur in schools, and it becomes quite tiresome to click and select the same species_name combo box value for each record when entering multiple individuals of fish of the same species.
What I would like to do is set the default value for that combo box (on the fish subform) to match the value entered for the previous record.
I suspect that you could use the after update trigger to execute some code to change the default value each time something is entered manually into the combo box. Unfortunately, I know nothing about how to write the appropriate code.
Can anyone offer me some guidance?
Thanks in anticipation.
Sincerely,
Craig Dolphin
View Replies
ADVERTISEMENT
Jan 17, 2013
Is there a method of setting the default value for new entries to the same value as the previous entry?
For example, I have a quality control information table that stores QC data for different lot numbers. It is annoying to enter in the lot number and product code field over and over again if there are dozens of records per lot number. Is there a way for Access to easily display the previous entry as the default value?
View 1 Replies
View Related
Feb 19, 2007
Hey guys,
I'm not sure how to do this, and I can't find any info about it, but is it possible to set a value for my date field to accept either
1) date
2) "TBD"
3) null
Is there a way to allow and exception of "TBD"?
View 5 Replies
View Related
Mar 6, 2014
I have a blank form that is usually entered from scratch, so all the fields are empty.
We do fill out the form with standard data occasionally, so I'd like to be able to assign a button or use a combo box to automatically fill those fields with predetermined data.
Two questions:
1) Can I use a 'on click' for a button to populate the data using this:
Code:
Me.Control1.DefaultValue = Chr(34) & Me.Control1 & Chr(34)
2) If I have a default value fill a combo box, will it save the bound column correctly since I didn't select it from the drop down itself?
View 6 Replies
View Related
Aug 21, 2006
i have a combo box on my form that uses UNION query to put "<select>" as part of the list items.right now "<select>" appears on top of the list but what i mtrying to do is when the form loads i want the combo box to have "<select>" selected and not just show blank unless someone click on the down arrow. i m sure there is a way/propoerty to do it but i cant figure it out. Also how can i make my combo box so user cant type in a combo box but select from the list.
View 2 Replies
View Related
Jan 10, 2007
Is it possible for me to specify the default value in a table as what was inputed in the previous record?
View 12 Replies
View Related
Mar 4, 2007
Hi
Im wanting to set a default text from a previous record.
I have a fields that has Start location and Finish location,
Im wanting to set a defaulf so that the Finish location from the previous record is defaulted to the Start location of the next.
Is this possible????
Please help.
View 9 Replies
View Related
Aug 5, 2013
I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.
Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...
View 1 Replies
View Related
Oct 28, 2014
How to set a new record view as default in form view???
View 1 Replies
View Related
Nov 13, 2013
I'm having trouble with a Form and getting a text box entry box (Date entry) default to the date entered on the last record, which is linked to a table.
The only way I can get it to work is to type the date into the Text Box's Default property, for example, #11/13/13".
How to get the correct syntax or code into the Default property of the Text Box to make this work? I only want the entry to change versus the previous record/entry if the User changes / enters a new date.
View 9 Replies
View Related
Apr 29, 2015
How to fill values in a new record with data from previous record?
I've total 11 columns in a table and values in 3 4 columns are repeating for few rows before it needs to be changed eventually. I want to fill these rows with values from previous record.
View 10 Replies
View Related
Jan 9, 2006
How might I go about taking the values fo certain fields in a previous record and place them in the same fields of the current record, using either a query or VBA?
I've seen something about being able to utilize previous record data but for the life of me I can't remember where I saw it!!
Any help is appreciated.
View 5 Replies
View Related
Jan 12, 2015
I have a database where I need to record student data, specifically marks and absenteeism. The marks are recorded each term as a running total. I have a final mark which needs to be equal to the 4th term mark.
I also need to record the number of days absent each term with a total at the end of the year.
My problem is that the term 4 mark is a in the previous record and the total days absent needs to be the total of the previous 4 records (term 1 - 4).
I using a create table query and an update query but that was a no go.
View 7 Replies
View Related
May 4, 2013
I've got a form (frmMain) with two combo boxes (cmbCategory and cmbProducts). I have set the combo boxes up to be cascading, so that when you select a value in the cmbCategory box, it influences what is visible and selectable in the cmbProducts box. What I wanted to happen is this:
1. User selects a category
2. cmbProducts defaults to the most recently entered Product within that category, and the form pulls up that product's details.
I have the cascading combo boxes set up so cmbCategory has an AfterUpdate event that runs a macro. In the macro is the command to refresh the cmbProducts box, and the cmbProducts box's RecordSource is set to a query that filters the Products based on the value of the cmbCategory box. I then set the cmbProducts Default Value to a DMax command that pulls the largest ID number from the query. Everything works great, except when I choose one category (the correct product comes up, the latest one entered for that product), then go back and choose a different category without reloading the form. The cmbProducts box stays showing the previous Product, and doesn't automatically update with the latest product for the new category. So it works the first time out of the gate, then just stops working, and won't work until I close and reopen the form again.
I've tried the refresh command, and I've tried adding an AfterChange event to the cmbCategories box. Nothing seems to work! I also tried running a close form/open form command in cmbProducts' After Update to enable the DMax command again, but this blanks out my Categories and Products boxes (which it's supposed to... I don't want anything to come up when you first open the form, both should be blank until you start selecting values).
View 2 Replies
View Related
Apr 12, 2013
I have a Contacts subform and would like to be able to double click to fill addresses, and details from the previous row...every person in our database even those living at the same address needs thier own record.. and since we only need to fill up to 5 records and review them, double clicking on the first name to fill up the next row with the previous addres phone number ect would be grand.
I am assuming we could fill out the new Full Name and double click on it to get the previous record filled to the new one. Don't really want to work with a query unless needed, but I have a little vba understanding.. how do I code this to make it work?
Full_Name_Dbl_Click
getPreviousRecord.Address(-1)
getPreviousRecord.Phone Number(-1)
getPreviousRecord.City(-1)
View 5 Replies
View Related
May 17, 2014
In my database scenario, a patient would see a doctor and the doctor would check off fields in a form representing different disease symptoms that the patient has to calculate a final score (for ex. if the patient has 2 symptoms, the final score would be 2).
After a few months, the patient would visit the doctor again, and the doctor will have to fill out the same form, adding any new symptoms the patient might now have. I would like to have the disease symptom fields checked off in the previous visit automatically show up in the new form, so that the doctor only has to add the new symptoms, and then recalculate the score using both the old and new data (for ex., if the patient had 2 symptoms before and 3 more symptoms now, the score would be 5).
View 2 Replies
View Related
Jun 2, 2015
I wanted to auto populate an invoice record with same values as previously ordered by that same customer. I don't want to use default values as every customer orders different things.
BUT almost all customers make REPEAT orders of exactly the same things they ordered previously.
So...for example, can I search the invoice records by customer ID/Name and copy all the data from their previous into a new invoice record. I guess I could do this with an append query?
But will an append query run when I just click on 'new record' in the invoice form? Maybe there is a property '.on new record'...open append query....?
View 1 Replies
View Related
Feb 8, 2005
Hello,
I suspect this is probably rather easy, but I've not been able to figure it out:
I am using a combo to select a record in a form. This works.
The problem is: When I navigate through the records in the form, the combo box does not "update". I need to be able to change the record displayed in the combo box as the record in the form changes.
Any ideas?
Many thanks in advance for assistance.
View 8 Replies
View Related
Mar 3, 2006
Me!ComboName.DefaultValue = Me!ComboName.ItemData(0)
this assigns the first value in the combo box to the default.
can this be changed to always assign the last possible record in the list as the default.
View 2 Replies
View Related
Nov 19, 2014
The next stage I'd like to include is a match and enter pricing details. We get a lot of repeat work that is entered onto our system, due to the nature of the work we do each item is then checked individually. There is a portion of this that could be automated.Our order intake table has an amount of information, various bits of which are supplied by various customers, but not always all of the information is required or given.
Id like a price to be copied from a previous record where the "shots" field matches a previous entry.The other fields that would need to be similar are the "coverage" "drawing no" "pattern no"..But only when these fields are populated, we often, but not always put a - in these fields where the information is not given. I think this may be bad practice, but it shows us the information has not been supplied, and not just missed from the order.
To sum up, when an order is completed i'd like to have an afterupdate event that searches the previous records, where cover, drawing no / pattern no are *matching* and the shots do match, then copy the price of a matching record, where that record is within 12 months of today (using the date_rec field) and then tick an "automated_price" field so i know the price has been generated by the system.
View 1 Replies
View Related
Jan 26, 2006
I have built an example of a form that I am working on. My original design used the default record navigator bars that are setup when you use the wizard to create the form. I would like to remove those bars and use the linked combo boxes that I have placed onto the form instead.
My end all goal is to have those two record navigation bars completely gone from the form and have the combo boxes perform the same function they were used for.
I would like to keep the data entry portion of the form the same because I like the design and I like that I can limit it to data entry only so theres no chance that the users will accidentally modify existing data. However, if you have a different method of entering the data that will still provide me with the protection of "data entry only" that will be welcomed.
View 12 Replies
View Related
Dec 10, 2013
I got a combo box with a few columns for locating query activity. However, how can I make use of it to locate a particular record according to predefined values, for instance in a loop, to locate records. The combo box got 3 columns, just want to know the syntax to define the combo box according to some values. I need to define only the first colmun or all 3 columns??
View 1 Replies
View Related
Jun 17, 2005
Hi,
I'm trying to set a default value to field in a form. The field relates to Table 1 and I need a value from Table 2 as Default!
I've tried entering an SQL query:
Select Max(ID) From.... ;
But it doesn't work! Maybe It's just a question of syntax??
Thanx for your help.
View 8 Replies
View Related
Oct 29, 2004
I am trying to set a default value in a date field. I would like for the default value for this field to be the date thirteen days from the last date entered. How would I go about doing that... Any help would be greatly apprecated.
Toyman
View 4 Replies
View Related
Apr 4, 2008
Hi,
I have a user who would like the value from the last entry into the form's title field text box to show as the default value when he clicks on enter new issue button to bring up a new record. I do not know if this is possible but I thought I would check for him.
View 14 Replies
View Related
Jan 25, 2006
I am not sure if I am even able to do this, but I am wondering how to set the default value for a field when creating a database using SQL. I am doing everything with coldfusion and I havn't been able to figure out what code needs to be there. I have tried everything I can think of. Any help would be appreciated.
View 2 Replies
View Related