Form Populates Two Rows In Table
Mar 13, 2008
Anyone know why the following would happen:
I have a form that is linked to a single table. For some reason some controls populate one line in the form and others populate another line.
Each time I complete the form it creats two records with some data in one row and other data in another row.
View Replies
ADVERTISEMENT
Nov 24, 2006
Hi everyone,
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" &
CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time
My code works: when you select something in CustomerName combo box, the other
boxes in the record get populated with data. The problem is that ALL the records in the
form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled
separately.
Any ideas?
Thanks,
Gilad.
View 1 Replies
View Related
Nov 24, 2006
Hi everyone,
I have a form with a combo box, whose afterupdate code is:
Private Sub CustomerName_AfterUpdate()
Dim rs As Recordset
Dim person As String
{This will contain the SQL Statement}
person = "select people.department from people where people.name='" & CustomerName.Value & "'"
Set rs = CurrentDb.OpenRecordset(person)
{Now the following are combo/text boxes that are populated}
Department.Value = rs("department")
InputDate = Date
InputTime = Time
My code works: when you select something in CustomerName combo box, the other boxes in the record get populated with data. The problem is that ALL the records in the form get populated with this data as well...
I want the records to be independent of each other - that each record will be filled separately.
Any ideas?
Thanks,
Gilad.
View 1 Replies
View Related
May 5, 2013
When I enter a combo box on a form, whatever I choose from the combo box, it populates everything. If I go to a different row to change it, it changes them all. How do I get that to stop? And why does it do that?
View 6 Replies
View Related
Jul 11, 2015
I'm building a simple access database to be used in a factory. It's pretty much there now, in the sense that it does all it needs to do, but some things feel a little "clunky". One of these things is the page where new products are created.
When a product is created the user has to specify what raw materials it's made up of and that works great, there is a continuous sub form that lets the user just add a row for every raw material. Having it as a continuous form makes sense as there can be lots of rows or just a few, so it's flexible.
Currently though the labour/time on that page works in the same way. But it feels a bit silly as there are only 3 sorts of labour (at least currently, they might add a couple more later). The labour types are..
- Build
- Finishing
- Handling
My question is, how would I go about turning the existing continuous row-by-row subform for labour into a single form that just listed those three types of labour (read from my labour type table)? So that it just shows a row that asks for quantity of each available labour type.
Not all products have all types of labour but it would be fine to write a 0 in the labour table for (for example) Finishing against a product that for example didn't need Finishing Labour. Obviously with the current continuous form approach no row would be written for Finishing if the user didn't select that.
I guess I could hardcode a single form to show the three current types, but ideally it would be flexible, coping with new labour types when the users find they need to add them.
View 5 Replies
View Related
Apr 15, 2014
I have a table with the following columns: Task, Visa type, time it takes to perform the task. There are several taks that are performed for all visa types. I want to create a form to enter data to the table in which for the field visa type I have a list box that can allow multiple values, however, I do not to create a single line with the task and on visa type all the types of visas selected. I want to create a line for each type of visa with the information introduced.
I don't know if this is possible, the reason for which I want for the form to create several rows depending on the visas types is because then I have a query that sums all the types of visas. Can this be possible? I don't want the people to introduce manually directly to the table the data and also that for the same taks they have to enter manually 50 rows with values. I want it to be more simple and easier.
View 3 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
Nov 25, 2005
I would like my form field to populate based on what the user selects from 2 combo boxes I have. I have a table set up with Region, Position, and Name. I would like when the user selects for example Eastern for the region and President for the position that John Smith would auto populate in the form field. Is this possible and if so, how can I get this to work?
View 1 Replies
View Related
Nov 23, 2005
What is the best way to get a field to automatically populate on a form when the user select criteria from 2 combo boxes. For example in cbo1 the user select Eastern and cbo2 the user selects Regional President. How can I get in a seperate field the name of the Eastern Regional President to populate?
View 10 Replies
View Related
Nov 15, 2006
Hello,
I have a simple question with an answer that hides relentlessly from me. I have a combo box on the main form called cboProjects. I also have a subform called SubProjectsDetails. I'm trying to get it to where if a user selects a project from the combo box, the details show up in the subform. The relationships are good and working, and if I add a Find Record button on the form, that works as well. I just don't know the code to dynamically populate the subform with combo box values.
Anyone have any tips?
Thanks
View 2 Replies
View Related
Sep 20, 2005
I have a combobox where users can select classes. In the AfterUpdate event for that combobox I have the following code:
Me.ClassCode = DLookup("[ClassCode]", "Classes", "[ClassID] = " & Me.ClassID.Column(0))
I want to populate the Class Code field based on the class they select. The code works fine except that the Class Code field does not update until after I tab past it. There is a field in between Classes and Class Code so I have to tab 3 times before the textbox populates. I expected the textbox to populate immediately after I selected the class. I also tried putting the code in the On Click event of the combobox but that didn't work either.
If I just keep clicking on different classes I'd like the class code to change each time without having to tab to another field. Is that possible? What am I doing wrong?
Rod
View 1 Replies
View Related
Aug 9, 2015
Code:
Me.PHOTO = " & Me.text36 & " & Me.FILENAME & "" & Me.FILENAME & ".jpg"
tell me what I have to change in the " & Me.text36 & " part so that the value displays the value in text 36 and not the words me.text36
View 1 Replies
View Related
Mar 15, 2005
All:
Currently have a Form / SubForm arrangement combining qryItemAllowedAndUnschedlued with tblInventoryItem.
The main form is based on the query and the subform on the table.
My effort is to create cascading combo boxes where a selection in the main form populates a "conditional" list in the subform.
More specifically, where the user selects ItemClass in the main form, I am attempting to populate a list of ItemCategories in the subform based on the selected ItemClass.
I have reviewed and continue to study existing posts on Cascading Combo Boxes and Form / Subform arrangements. However I currently have a question I do not see covered...
When I select my ItemClass it is populating throughout the query and not solely in the current record displayed.
Does anyone know why this may be?
I fear the answer is a simple setting that my current experience is making difficult to isolate. I trust it will present itself with patience, but in the interim more experienced feedback is welcome!
Regards
View 1 Replies
View Related
Oct 25, 2006
Simple question but I've been stuck for a looong time.
So what I want to do:
1. enter a value into a text box (Home_Tel) in a form (frmStudentClass)
2. which runs a query (qryNameTel)
3. and return the results to a combo box (Student_Name) on the same form.
The same Home_Tel may have several Student_Name results.
-I have entered
[Forms]![frmStudentClass]![Home Tel]
for the criteria in the query
- However I can't get the results to turn up on the combo box
- I have the following:
Private Sub Home_Tel_AfterUpdate()
' run query
DoCmd.OpenQuery "qryNameTel"
Me.Student_Name.Requery
End Sub
Any ideas?
Or is there an easier way to tackle the problem?
Home_Tel and Student_Name are from the same tables.
I have created a query just for Home_Tel and Student_Name
Thanks everyone!
View 1 Replies
View Related
Nov 10, 2014
In a situation where I imported an excel file with so many columns and split them into two temp tables and they are linked using a key.
the data has a fixed part lets say
Field1....Field2.....Filed3.....Field4...then Field5.....Field6.....Field7....Field8 is the same data range as Field9...Field10...Field11...Field12. I would want to split this data into multiple rows like this
Field 1 Field2 Field3 Field4 Field5 Field6 Field7 Field8
Field 1 Field2 Field3 Field4 Field9 field10 field11 field12 and so own...
What is the best approach?
View 3 Replies
View Related
Mar 10, 2015
I am trying to assign teams to players. I have an import table with all of the players information listed. What I want to do is determine the count of players in a given city. For every 9 players I want to add a new record to the Team table and assign the team number (auto incremented for each team created). Then I want to add the players to the Players table with the Team Number that was created.
View 8 Replies
View Related
Jan 13, 2006
A SELECT works:
SELECT *
from mastertable
INNER JOIN secondarytable
ON mastertable.Identicalfield = secondarytable.Identicalfield
But none of these do:
DELETE
FROM mastertable
INNER JOIN secondarytable
ON mastertable.Identicalfield = secondarytable.Identicalfield
**Incorrect syntax near the keyword 'INNER'.**
DELETE
FROM mastertable JOIN secondarytable
ON (mastertable.Identicalfield = secondarytable.Identicalfield)
**Incorrect syntax near the keyword 'JOIN'.**
DELETE
FROM mastertable
WHERE (mastertable.Identicalfield = secondarytable.Identicalfield)
**The column prefix 'secondarytable' does not match with a table name or alias name used in the query.**
DELETE
FROM mastertable
WHERE IN (SELECT *
FROM secondarytable)
**Incorrect syntax near the keyword 'IN'.**
Can anyone help? This should be easy, shouldn't it?!
Thank you.
View 2 Replies
View Related
Sep 19, 2013
I'd like to learn how to do them quickly and effectively in Access. One of those things seems like it would be an incredibly simple, intuitive operation, but it's not, at least not to me.Say I have some data that really should only be on one table, but it's currently on two tables in Access: "List Main" and "List September Adds." They both have the following fields: "Full Name" "Email" "Address" "City" "State" "ZIP" "Phone."
The first table is my main list of contacts. The second contains new info, consisting of 1. a few new contacts, and 2. updated info for a few of the contacts already in table "List Main."
I would simply like to put all the new contacts from "List September Adds" into my "List Main" table, and I'd also like to fill in a few missing e-mails in "List Main" with newly gathered e-mails for those contacts, info that is in my table "List September Adds."I'm sure there is built-in functionality to do something as basic as essentially turning two pages of the same spreadsheet into one. In fact, I know I could import data from an Excel file and have it "append" to a preexisting table if the fields are all the same.
However, I'd like to know how to do it when the tables are already in Access (without having to learn any SQL, mostly because I'm fairly certain I don't need to know SQL to do something like this). I've heard of Append and Update Queries and given their names, it sounds like they'd be useful, maybe with use of "Totals" and "Group By" to get rid of duplicates; however, I can't seem to get any of this to work right.
Mostly, when I think I am doing an Append correctly, it doesn't add new data at the bottom of a table; it just wipes out all the data that was there, and replaces it with data from the source. For instance, when I've been running an Append Query to get my "List September Adds" rows into my "Main List" table, what I end up with is only the "List September Adds" rows, and all the "Main List" rows gone.
View 7 Replies
View Related
Aug 30, 2013
I have a query that populates a report linked to a mail merge. There is an IFF statement in it that checks to see if a condition is meet. If that condition is meet some standard text results. Is it possible to put a disclaimer with the standard text.For example,
Code:
IIF ([Results]="Negative","Nothing detected" (the disclamer would go here)
I am not certain the correct syntax to use to insert "not all regions were tested".
View 1 Replies
View Related
Feb 11, 2008
I think my question is fairly simple - fingers crossed.
I want to create a field that, whenever a record is added, it auto-adds the date & time the record was created. I'd call it Book_Date_Added, or something like that. I tried snooping around the Default Value options but couldn't figure it out.
The table exists and it already has some records, so I'd need to know how to add this field rather than how to create it when I create a table (although that would be helpful too, if it's somehow different).
I'd appreciate any help, thanks a bunch.
View 3 Replies
View Related
Jun 1, 2007
The following is for a successful pet grooming business.
I have a Customer Table with a Customer ID as primary key. I have a Pet Name Table with a Pet ID as primary key. One customer can have many pets. The Pet Table is linked to the Customer Table via the Cust ID. I have a Visit Table with an Auto Number for each visit. The Visit Table is linked via the Pet ID number. Each pet can have many visits. That's the problem. We have exceeded the 64,000 rows in the Visit Table. All three linked tables support all the queries, forms and reports. How can I continue beyond 64,000 visits.
Thanks, Jed
View 10 Replies
View Related
Jun 14, 2007
I tried to search for the answer but not luck. I know there is a max size around 2gb for a DB but is there a row limit for a table or is it based upon size?
View 4 Replies
View Related
Nov 7, 2006
Hi.
How I can delete all rows from my table whit on query? Also I want that when I delete rows from my table index and other settings will stay in table.
View 1 Replies
View Related
Dec 17, 2004
Is there any way to get the last 4 rows which have been entered into the table?
Thank You.
View 2 Replies
View Related
Nov 14, 2005
Hi,
I have a table with four columns - A, B, C, D
I want to compare the values in columns A, B and C in row 1, with the values in row 2 and if they are the same, I want to copy the value that is in column D in row 1 into column D in row 2. I then want to move to the next row in the table and compare the values in row 2 with the values in row 3 in the same way. This will continue for all rows in the table.
Any help would be greatly appreciated as my VB is not up to much.
Thanks in advance
View 2 Replies
View Related
Apr 5, 2012
I am working on a project that requires to calculate interest on the amount. There are 2 tables, 1 with Interest rate for a product for different and periods and another is product table with amounts in different period.
Table 1 (Rates table)
Product From To Rate
1111 1/1/2012 1/20/2012 .75
1111 1/20/2012 1/28/2012 .50
1111 1/28/2012 4/6/2012 .40
Table 2 (Product table)
Product From To Amount
1111 1/1/2012 1/17/2012 10000
1111 1/17/2012 1/24/2012 15000
1111 1/24/2012 2/25/2012 20000
What i need to do is to calculate interset based on the above 2 table and insert into another table (Interest). However, the problem is with identifying correct rates for the periods in Table 2.
Eg.
for period 1/1 to 1/17: applicable rate would be .75
for period 1/17 to 1/24: From 1/17 to 1/20 the rate would be .75 and from 1/20 to 1/24 it would be .50
this is what i want to achieve, basically to split the period between 1/17 to 1/24 into 2 so that appropriate rate can be applied.
View 1 Replies
View Related