Forms :: IF Statement Not Putting Data Into Tables?
Apr 1, 2014
I am doing an assignment for uni and need to be able to autofill a textbox with the price of a service based on whether a checkbox, detailing whether the invoice has been paid, is ticked. I found the following formula which works: =IIf([Invoicepaid]=True,[ServPrice],0).
I put this into the control source box on my form but the only problem im having is that the price of the service is not being updated into the actual invoice table.
View Replies
ADVERTISEMENT
Jul 16, 2013
I am trying to create a form in which users can save new supplier data to a database. I am using two insert statements which insert similar data in to two similar tables. The insert statements appear to have no problems and no errors are produced upon execution yet the new data doesn't save into the tables. Here's the code;
Code:
Private Sub Command14_Click()
Dim sqlstr As String
Dim dbs As Database
[code]...
View 11 Replies
View Related
Sep 17, 2013
I have multiple tables that are linked to excel. I am creating a product selection tool to make it easy to find the products contained all these linked tables. They are necessary as they contain pricing data and information necessary to be kept in excel which is regularly updated.
Is there a way to create one table containing data from all these linked tables? I tried using an append query but realise that when the linked tables are updated the table containing all the data wont be?
View 3 Replies
View Related
Dec 2, 2013
Using an example:I have three tables; tbl_weight , tbl_height , tbl_bmi...How do I make tbl_bmi automatically use the weight and height values (height/ weight) to determine the tbl_bmi values? Is there a way to store code behind the tables as if I was in MS excel?
View 2 Replies
View Related
Sep 29, 2014
I am developing a simple database for students to register courses using Microsoft Access 2010. I have 4 tables: Student, Register, Course, and Section (1 Course can have many Sections).
Then, there is a criteria that a student can only take up to 6 courses. Hence, may I know that where and how can I include this constraint? I believe that it should be in the Macro (Before Change) of the table Register...
My relationship is: Student -> Register <- Section <- Course
View 1 Replies
View Related
Jan 15, 2015
I have 2 databases with the same structure, but different data.
I want to put all the data in 1 database.
The problem is that the most important table (clients)has an autonumeric id field, that is used to link the records to the fields of many other tables; so, I cannot delete or change that field without losing connections.
View 4 Replies
View Related
Jun 23, 2015
I have a database that had some code that enabled the user to click a button and it would take information from one Access query or table and paste it into specific locations in Excel. This is important because the last worksheet has specific formatting in place.
If it didn't, I'd just use the transfer spreadsheet option and not even bother opening Excel at all with code.
I've got it working well except for the last part. The last query being copied has eight records and only one is being sent to Excel. Same code as the other queries where all of their data is going to the right spot in Excel with the right number of records.
Private Sub AM_Top_25_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_ShortPartItems", acNormal, acEdit
DoCmd.OpenQuery "append_to_Short_Part_Items", acNormal, acEdit
[Code] .....
View 3 Replies
View Related
Aug 4, 2005
I ma going to sound a complete idiot with this question, but I have been working on a database for some time now, successfully putting buttons on forms with the wizard, jumping from form to form, form to report, basically the button wizard used to work now it doesn't and I don't think I have done anything stupid. (I hope). The wizard was brilliant, I'm lost without it. How do you restore it?
Thanks in advance guys. :confused:
View 2 Replies
View Related
Apr 5, 2015
I have a combo box with an associated label.
I want to eliminate the label and have the label text be part of the row source of the combo box.
The combo box is based on a select statement.
View 14 Replies
View Related
Dec 9, 2014
i have a split form in ms access that has the data source of a linked table in sql server. this form has some fields those are bound to the columns of a table. I want to have a button that would appear in front of each rows. do you know how i can do this?
in a continius form when i will create a button it will be appeared continiously. how can i do this for split form in ms access
View 1 Replies
View Related
Mar 8, 2013
My table has 3 fields, Employee Number (text), Job Description (text) and Current (yes/no). The table keeps track of the Job Descriptions that an Employee has had along with his current Job Description (actually Title is more appropriate a word but client requested Description) So the table has records such as:
0001 - Floor Sweeping - no
0001 - Ceiling Cleaning - yes
0001 - Dumpster Turning - no
The yes signifies that that is the current Job Description for employee #0001 and the others with no are previous Job Descriptions that the employee #0001 has held.
Now - I created a form to add these records to the table and on that form I want a list box to show the records in the table for this employee but I want to sort it such that the current Job Description is listed first and the rest show up in alphabetical order following. I have the query to list all of the Description, but how can I get the current one to always appear on the top of the list?
View 14 Replies
View Related
Oct 15, 2013
I want to calculate the average of 16 anodes from text box into the "average drop" box and simultaneously want the data to be saved in the table too as one of the fields. Also, How to load form view while the database loads?
View 10 Replies
View Related
Feb 21, 2005
How does one cause certain data to appear in another field based upon the data entered in another field.
For example: I enter in the field the word "Carrot" in a field called food and the word "Orange" appears in the field color. And then if I enter the word "Beans" in the field food then the word "Green" appears in the field color.
Thanks for you help in advance.
Eric
View 1 Replies
View Related
Sep 3, 2014
I am using Access 2010.I have a table that I am using to pull my data from other tables and a query.My table is called tblMyData.One of the field names is level1. This field points to another table, and gives the user the choices for states (examples California, Texas, Maine).
Another field name is level2. This field points to another table and give the user the choice for type of customer (examples Business, Consumer)
The field name level3 points to a query. The query, qryFinalChoice matches up the choices based on level1 and level2.for example, the user can pick California for level1, business in level2 and California Widgets or Los Angeles Clothing store in level3 (plus about 20 other choices).
If the user picks Texas for level1, business in level2, business in level2 and Houston rugs, or Texas style restaurant in level3 (or about 15 other choices).
-I am recording 1 for California on level1, 2 for Texas and 3 for Maine in level1.
-I am recording 1 for business and 2 for consumer on level2.
The query qryFinalChoice has all the combinations for state, business or consumer, and lastly business name or consumer name.
-qryFinalChoice has line1 to match up the choices for level1 in my table.
-qryFinalChoice has line2 to match up the choices for level2 in my table.
-qryFinalChoice has line3 to match up the choices for level3 in my table.
I do not want any of the Texas business names appearing when the user picks California, or vice versa.
My SQL in my tblMyData tab for level3 looks like this:
Select line1 from qryFinalChoice where line1=1;
I am able to get all the line items where California is a selection.How do I change my SQL to pull all the line1 choices where I have selected from level1, and all the line2 choices where I have selected from level2 automatically based on my pulldowns?
View 1 Replies
View Related
May 27, 2013
I am a girl guide leader trying to make a faster way to keep track of my unit's completed badge and program work. I have made tables for every area I need (I started with one table but it was too large to change into a form).
In total I have:
- Basic Member table (main information like their name and how many years they have been in, whether they are still in the unit, etc)
- Program area tables
- Interest badge tables
What I want to do is be able to "add/edit" members from the main form, then go to all the sub forms for their program and badge work -- problem is, how to link them!
I am using Access 2007-2010.
View 2 Replies
View Related
May 13, 2015
I have form with a combo box that displays error messages from Table A. These error messages are linked to Table B via an ID. The other table also contains an error message. I can obviously display the error message and ID from Table A in the drop down box.
What I want to be able to do is display the error message from TableA and also the error message from Table B.
Is this possible and if so how?
The control is bound to a further table but the ROW source is via a select statement. Is it as simple as changing the select to some query? If so how do I select the fields to display or are all the fields in the query displayed?
View 6 Replies
View Related
Aug 8, 2014
I am creating a new database and every time I try to add new data the old gets overwritten. This happens if i put the data in the form or if i put the data directly in the table. Don't know what i am doing wrong new at access and this is the first database i have tried to create. I have the date in as TEXT because i only need the actual month not specific dates. I found this out because i need to make a query that will take the prior months mileage and subtract it from the current months mileage so i can get total miles driven in the month.
View 14 Replies
View Related
May 17, 2015
Is it possible to populate a single combobox with data from 3 different tables.
I have a table called observations (for observing deer), in that table is a field called Location, I have 3 other tables that list possible locations t_foodplots, t_stands and t_section.
I would like to have a combobox called location on my observations form that will allow me to select the proper location from one of those 3 tables, the choices would be something like this...
Section 1
Section 2
Section 3
Stand 1
Stand 2
Stand 3
Foodplot 1
Foodplot 2
Foodplot 3 etc....
The chosen value would be stored in the t_observations "location" field.
View 1 Replies
View Related
Nov 27, 2006
I understand that any data that is inputted into a form is always transferred back to the table in question.
In the form I created, I had
4 subheading scores added together to form another subheading named function =([1]+[2]+[3]+[4])/4 was the formula that I put into the control source. The calculation worked fine on the form giving me the correct name. However, this number did not transfer back to the table simple being labelled as zero. Can someone please advice!
View 14 Replies
View Related
Sep 12, 2013
I have a form within my database in which the user will enter data which will go into 2 separate tables. These 2 tables (Job and Client) are related. At the moment I have a subform in which the user enters Job information, and the main form where the user will enter client information.
The problem being is that the 2 sets of data do not associate themselves with each other, despite being related (The Client will be related to a job number. A client can have many jobs but a job can only have one client etc). It has to be done manually in the table which is not ideal as the DB will be split and rolled out to users via Access Runtime. I have been working on this DB for a while now and the problem is most likely right in front of me but I cannot see it!
View 4 Replies
View Related
Sep 13, 2013
My DB tracks sponsors for a non-profit organization. Demographics, sponsorship levels, tickets to events, payments, members who recruited sponsors, etc.
I have a form EditSponsors which opens from a query that draws from 3 tables SponsorshipDemographics (PK SponsorID), SponsorshipLevels (PK SponsorLevelID)and Members (PK MemberID).
I have placed a command button on the form that opens a new form PostPayment which is intended to post a payment and make the necessary changes to the sponsor’s profile.
I want to load the new entered data form PostPayment with selected fields from EditSponsors, then create a new record in the table Payments that looks like this:
PaymentID (PK, Auto)
SponsorID
SponsorLevelID
MemberID
Check#, CheckDate, PostDate, Amount (data entry)
My Problem: The 3 PK’s from the other tables do not get entered into the new record in Payments.
View 1 Replies
View Related
Mar 3, 2014
I have a database I made to store a list of users and information about each user.
I have a UserDetail table, languages table, previous experience table, current experience table.
UserDetail table as follows:
UserID (PK)
First Name
Last Name
Full Name (calculated)
Department (using a multi select combo box. There are 3 departments and some people are in both).
I need to do the same thing on each table and each table is very similar so I'll just list one. This is the Previous Experience table:
PreviousXPID (PK)
Previous experience (e.g. IT, Marketing, Chemistry)
I have three junction tables. One for each Previous Experience, current experience and language table. The Previous experience junction table has:
ID (PK)
UserID
PreviousXPID
I created a relationship between the userdetail table and the junction table then the junction table to the Previous Experience table.
Now what I'd like to be able to do is edit people to add previous experience, current experience and languages to each. I already have a form that lets me add a new user to the database. It's just based on the UserDetails table. If I could have a way (perhaps using 3 multi select list boxes. One box for previous experience, one for current experience and one for languages) on that form to add the other details to that person, that would be ideal. I'd like to create a new user. E.g. Joe Bloggs in department 1 who speaks Dutch, used to have Marketing, Chemistry and aeronautical experience and now works in IT.
I can create the new user by putting last first/last name and selecting the department. But to add experience or languages, I have to go into that junction table and add the numbers myself. e.g. user 1, has experience 1,3,4 and 5. I'd like to see the name that relates to the ID and be able to select it from the list in the table I have.
View 11 Replies
View Related
Nov 19, 2013
How do I create a form that will allow me to enter data into three different tables?
I have a rather simple database for tracking students. When I get a new student I need to take information off their paper application and enter it into three separate tables, Student, Families, and Demographics. Each of these tables contains the fields StudentID, StudentFirst, and StudentLast.There is a relationship between the StudentID field on each table, with Student being the main table and Families and Demographics coming off of it. All relationships are one to many. StudentID is the key for the table Student.
I want to create a form to add a new record to each of these tables. I want my data to be displayed in the Columnar style. I only want to enter StudentID, StudentFirst and Studentlast once and have it populate to all three tables.
I can create a form and a query that displays existing entries exactly like how I want to enter them, but of course I can not edit or add to them. I have tried using subforms, but they don't seem to link up. Once I enter the Name, I want it to be on all the forms. I don't want to have type it three times. I also tried creating three separate forms and connect them with the Navigation Form. The issue again is that once I enter the name in one form, it is not automatically on the next form.
View 3 Replies
View Related
Apr 17, 2013
I have a form where I am entering orders. For this, there is only 1 item and 1 customer per order. The Order_Table is the 'general' of the form. However, I want a Customer_name dropdown on the form, and return data to 'display' on the form (but capturing and ONLY storing the Customer_no), once the user makes a selection.
Additionally, in the same vein, I want to have an Item_name list, where the user selects one from the listing, and display (again, no edit) the name. Again, only want to store the Customer & Item numbers on the Order table.Here's the 'general' table layout (I've taken out what doesn't matter):
Table: Order_Table
Order_no
Customer_no
Item_no
Table: Customer_Table
Customer_no
Customer_name
Table: Item_Table
Item_no
Item_name
View 1 Replies
View Related
Sep 5, 2005
Hi there
I am hoping someone can give me a few pointers on how to get started on what I am trying to achieve....
I have 2 tables that form a 1 - to - many relationship.
I have designed a form that I wish to show fields from both tables.
Using ADO I would like to be able to open the form and be able to see my desired fields in the same form.
Can anyone provide any ideas on where I can get started.
Thanks for your help!!
View 3 Replies
View Related
Dec 3, 2005
Dear members,
I have two databases, Source and destination ;
strSrceDB = "C:WSS_DBRehabilitated_Water_Supply_Kulyob.mdb"
StrDestDB = "C:DBWSS_Khatlon.mdb"
I would like to append records to the destination table (Contractor_GIS) when there are no matching records in the source table (Contractor).
My code is as follows:
Private Sub CommandButton1_Click()
Dim strTemp As String
Dim strSQL As String
Dim StrDestDB As String
Dim strSrceDB As String
Dim mdb As DAO.Database
On Error GoTo ErrorHandler
strSrceDB = "C:WSS_DBRehabilitated_Water_Supply_Kulyob.mdb"
StrDestDB = "C:DBWSS_Khatlon.mdb"
'Make sure it is there
If Dir(StrDestDB) = "" Then
Call MsgBox(StrDestDB & " does not exist", vbOKOnly, "Aborting...")
ElseIf Dir(strSrceDB) = "" Then
Call MsgBox(strSrceDB & " does not exist", vbOKOnly, "Aborting...")
Else
strSQL= "INSERT INTO Contractor_GIS("
strSQL = strSQL & "System_ID,"
strSQL = strSQL & "Contractor_Name)"
strSQL = strSQL & "IN '" & StrDestDB & "' "
strSQL= strSQL & "SELECT Contractor.System_ID,"
strSQL = strSQL & "Contractor.Contractor_Name "
strSQL = strSQL & "FROM Contractor IN '" & strSrceDB & "' "
strSQL = strSQL & "Contractor_GIS IN '" & StrDestDB & "' "
strSQL = strSQL & "where Contractor.System_ID <> Contractor_GIS.System_ID;"
Set mdb = DBEngine.OpenDatabase(StrDestDB)
Debug.Print strSQL
Call mdb.Execute(strSQL)
mdb.Close
Set mdb = Nothing
DoEvents
MsgBox ("The Geodatabase tables have been successfully appended!")
End If
Exit Sub
ErrorHandler:
strTemp = Err.Description & " [Update_SystemTab]"
Call MsgBox(strTemp, vbCritical, "Contact Help Desk")
End Sub
I get Syntax Error in "Insert into" clause.
Any help on this will be most appreciated.
Thanks in advance.
Irshad
View 2 Replies
View Related