Tables :: Updating Fields In Multiple Tables Without Onclick Event
Oct 23, 2013
I am working on a database which has two tables used as part of a registration and login process.
I would like a couple of fields from table one to automatically update in table two, once the fields in table one are populated without using an 'on click' event.
The reason I would prefer not to use an onclick is because the completion of the form used to generate the users table does not require any buttons for the data to save.
View Replies
ADVERTISEMENT
Mar 11, 2013
I am working with MS Access. The database has 2 tables.
-Parent and Student and ParentID is the Primary key as a parent may have multiple Students
-There is a form that lets me add students for a particular parent
One of the fields in the Parent Table is FeeDue. I added a field in the Parent Table called NumOfStudents..What I want to do is as follows: When a student is added on the Student Form, I want fee to be calculated automatically for display AND update the FeeDue field in Parent table. Event handler executed when a student is added (checkbox clicked)
OnClick()
{
Read NumOfStudents from Parent Table
if(student_added = true)
NumOfStudents++
else /* This is to cover student withdrawl*/
NumOfStudents--
if(NUmOfStudents = 1)
Fee= 400
else
Fee = 500
}
student_added check box is on the student form NumOfStudents and FeeDue are fields in Parent
View 1 Replies
View Related
Jun 11, 2013
I have data that needs to be entered. It is the same data across 3 tables but only for the first three columns, then it is different. I can create a form for one of these but not for all three.
View 4 Replies
View Related
Jan 10, 2008
I am working on a database at my workplace. We have a list of available IP adresses that can be used for printers, not all of which are in use currently.
I have a table for the printers at each branch, and that printer's IP address.
I have an IP addresses table that contains all available IPs, a domain name field, and a yes/no field entitled "In Use?"
I want my IP address table to check my printer table, and put 'yes' in the "In Use?" field if the IP address exists in both tables, or a 'no' in the "In Use?" field if the IP address is not currently assigned to a printer.
Can this be done, and if so, how?
Much appreciated,
~Mike
View 2 Replies
View Related
Oct 9, 2014
I am in the process of building Append Queries for new records, and I know I can do an Update Query to enter specific information. However, how can I update multiple records from a (externally sourced) linked table to fill in blanks of an existing table? I have created a query to identify records with 1 or more matching criteria which contain the blank fields. I now want to update those blank fields. The data in each blank field is different for each record (same type, just different data).
View 1 Replies
View Related
Oct 28, 2013
A small issue I was wondering of for a few day . Is it possible in SQL query to SELECT multiple fields from multiple tables ? Example for the question is
Code:
dim my_var as String
my_var = "SELECT Emp_FName , Emp_LName , Emp_Adress " _
& " FROM Table1 " _
& " AND Emp_Date_Of_Payment , Emp_Sum_Of_Payment " _
& "FROM Table2 " _
& " WHERE Emp_ID = 3 "
Is this code actually valid in SQL gramatics , and is it usable if passed to a Recordset variable ( rs = CurrentDB.OpenRecordset(my_var) ) ? Just FYI - The two tables are not related and I want to keep them that way (If possible relate their records just via SQL/Vba )
View 7 Replies
View Related
Apr 12, 2013
I have 10 tables, 30+ fields on each table (every table has the same 'account number' field). I only need from 5 - 20 fields from each table. How do I get the certain fields from each table and put them in a table, query or report?
View 1 Replies
View Related
Nov 26, 2005
I have a data entry form where country(ies) (there can be more than one for
each project) is/are entered in a sub-form on a tab control. Countries not
listed are entered by the following:
Private Sub CountryName_NotInList(NewData As String, Response As Integer)
Dim strSQL As String
Dim strMsg As String
Dim ctl As Control
Set ctl = Screen.ActiveControl
strMsg = "Country " & NewData & " Is not listed!" & vbCrLf & "Do you want to
add it?"
If MsgBox(strMsg, vbYesNo, "Not listed") = vbYes Then
strSQL = "INSERT INTO tblCOUNTRY (CountryName) "
strSQL = strSQL & "VALUES('" & NewData & "');"
CurrentDb.Execute strSQL
Response = acDataErrAdded
Else
ctl.Undo
Response = acDataErrContinue
End If
End Sub
This works fine. However, if I restrict the country names by a region
selection on the main form (for example if region Africa is selected on the
the African countries are preselected) the NotIn List does not work. Any way to work around this?
Another question, I want the user to select a region (a combo box ) on the
main form and when a new country (using the NotInList event) is entered in the subform both values go into
the same record in tblCountry (which has two fields CountryName and Region).
For example, I enter AFRICA for region on the main form and on the sub-form I enter Malawi which is not listed. I have tried the following:
Private Sub CountryName_NotInList(NewData As String, Response As Integer)
Dim strSQL As String
Dim strMsg As String
Dim ctl As Control
Set ctl = Screen.ActiveControl
strMsg = "Country " & NewData & " Is not listed!" & vbCrLf & "Do you want to
add it?"
If MsgBox(strMsg, vbYesNo, "Not listed") = vbYes Then
strSQL = "INSERT INTO tblCOUNTRY (CountryName, Region) "
strSQL = strSQL & "VALUES('" & NewData & "', FORMS!frmAddPro!Region);"
CurrentDb.Execute strSQL
Response = acDataErrAdded
Else
ctl.Undo
Response = acDataErrContinue
End If
End Sub
But it does not work (Region is the control on the main form named frmAddPro).
Any suggestions would be welcome. Thanks.
Niels
View 4 Replies
View Related
Oct 2, 2006
Attached is a project I am working on. It's a personal reminder program. The problem I am having is that when I enter the actual completion date at the bottom and click on the "Complete Task" button, I want the record to be copied to the History table, then the Start Date and Due Dates reset based on the Frequency. If someone could look at the On Click event procedure for this button and help me get this fixed, I would appreciate it very much. I don't know much about VB or SQL coding.
Thanks,
Jim
View 3 Replies
View Related
Mar 16, 2015
How to trigger the below VBA Code under one Change() Event once a selection is made from the only combobox on my form.
Code:
Private Sub cbxAssociate_Change()
Me.txtFIRJuly14.Value = DAvg("FIR_Perc", "tblFIRStats", "[Associate]= '" & Nz([cbxAssociate]) & "'AND [Month] = 'Jul-14'")
Me.txtFIRAugust14.Value = DAvg("FIR_Perc", "tblFIRStats", "[Associate]= '" & Nz([cbxAssociate]) & "'AND [Month] = 'Aug-14'")
Me.txtFIRSeptember14.Value = DAvg("FIR_Perc", "tblFIRStats", "[Associate]= '" & Nz([cbxAssociate]) & "'AND [Month] = 'Sep-14'")
[Code] .....
View 8 Replies
View Related
Jun 27, 2005
I am trying to setup a database for vehicle stock control.
Im not sure if I have gone about this the right way as I am new to this but thus far it is working correctly except for one annoying problem.
The database consists of so far
tblIAWVehicleDetails (Primary key "IAWvehicleID" autonumber)
tblIAWSellers (Primary key autonumber)
tblIAWBuyers (Primary key autonumber)
tblIAWStates (Primary key autonumber)
tblIAWStatus (Primary key autonumber)
tblIAWSafetyDetails (Primary key autonumber)
tblIAWSold (Primary key autonumber)
In the Vehicle Details table a stock number has to be manually added as this will be used for new stock as well as current stock (Number range from 100 - whatever) "IAWVehicleNo".
This table contains all relevent data with reguards to make, model, bodytype, color etc.
The sellers table contains the details of the seller Name, address, Phone, LicenceNo etc.
The Buyers table contains employee names.
The States table contains all Australian states.
The Status table contains current vehicle status Retail, Wholesale, Wrecking etc.
The Sold table contains the details of the person who purchased the vehicle if sold.
The Safety details table contains a safety checklist for pre purchase inspections eg: Headlights yes/no checkbox, Headlight text field for any extra info.
It also has a field for a safety Certificate No once the vehicle is checked and recieves a Safety cert.
The forms are setup as
frmIAWVehicleDetails
frmIAWSellers Subform
frmIAWVehicleSafetyDetails
frmIAWVehicleSafetyDetails Subform
The Vehicle Details,Sellers,Sold & SafetyDetails tables all have the IAWVehicleID & IAWVehicleNo Fields but when the details are entered through the forms the IAWVehicleNo which is the manually entered number only updates to the tblIAWVehiclesDetails but the other IAWVehicleNo fields in the other tables remain blank.
Any advice or help would be greatly appreciated.
View 6 Replies
View Related
Sep 21, 2012
I have a table that is going to track people. First Name, Last Name, and Date of Birth in three separate fields.I dont want to be able to add the same person in the table. How do i do this when the data is in separate fields.
View 9 Replies
View Related
Oct 21, 2012
I have a member table and donation table. For a donation, I'd like to lookup the last and first names from the member table. I set the lookup for the last name and can see bothe first and last names in the drop down list. When I pick, I get the last name in the DonationT but how to I pick up the first name? That is, how do I fill DonorFirstName in DonationT from the FirstName field in the MemberT?
View 3 Replies
View Related
Dec 6, 2012
What I have is a table ('tblJobLog') with our main listing in it where we add customer job information as it comes in. The 'Customer Name' is a dropdown list that links to our table 'tblCustomers' so that we can ONLY select a customer name that we deal with. The alternative is to add a customer or list them as COD.
Now this is where I would like to target, the COD's. We still like to keep a record of who the COD is and we have some common customers that are listed as COD only.... So when we go to enter the customer name we have to put COD and in the description we are suppose to input the customer name (We will says RandyShop <--- me, for now).
What I would like to have done, if possible, is to see when we select 'RandysShop' from the dropdown, it checks to see if the COD Status (in the 'tblCustomers' table) is set to YES (its a check box, or YES/NO field). If it is set to YES (or selected) then the change the name shown in my main 'tblJobLog' to look something like COD: RandysShop.
The reason I would like, if possible, to do it this way, is because some customer go on and off COD regularly as the mess around with payment. So instead of creating a new customer that is listed as COD: RandysShop to have access do the leg work based on a simple YES/NO field (COD Status).
View 12 Replies
View Related
Jul 14, 2015
I have two fields [InReview] and [TestReviewed].I'm trying to create a filter in the Onclick event of a button like so:
Code:
Me.Filter = "InReview Is Not Null" & "TestReviewed Is Not Null"
Me.FilterOn = true
This is not working for some reason. What is the correct way to concatenate a filter in VBA?
View 2 Replies
View Related
Feb 20, 2006
Hi All,
Being a newb, have a hopefully straightforward question. I'm writing a vehicle management database which covers eleven seperate areas. The data is currently contained in a spreadsheet with eleven seperate data sheets, one for each area. My thinking is I use linked tables as the spreadsheet needs to be occasionally updated.
My difficulty...
If I want to cycle through all records, I assumed I could query against all tables but don't seem to be able to.
The tables are not currently linked in any way and contain fields such as registration, emissions, list price, make and model and so on.
Any suggestions would be greatly appreciated.
Many Thanks
Q :)
View 1 Replies
View Related
May 25, 2006
Below is a Tab Delimited section of text to represent a SQL Table.
This is the result set of a select * from table where RNmbr = 0508.
I added the Top Row of A TAB B…TAB H
Row 1 references Column names of SQL Table.
And the First Column (under A) as Excel references.
A B C D E F G
1 RNmbr MesPt R1 R2 R3 R4
2 0508-1 1 28.0 48.0 48.0 74.0
3 0508-1 2 77.0 78.0 75.0 48.0
4 0508-1 3 81.0 59.0 65.0 56.0
5 0508-1 4 54.0 46.0 24.0 25.0
6 0508-1 5 21.0 2.0 15.0 74.0
7 0508-1 6 4.0 88.0 68.0 14.0
8 0508-1 7 8.0 94.0 87.0 96.0
9 0508-1 8 9.0 76.0 66.0 58.0
10 0508-1 9 48.0 48.0 35.0 74.0
11 0508-1 10 36.0 59.0 26.0 888.0
The challenge:
We can easily create STDEV(R1), STDEV(R2), STDEV(R3), STDEV(R4) from the above info.
However, we need to do a STDEV of all these points combined.
Within Excel, this is easily accomplished with the formula
= STDEV(D2:D11,E2:E11,F2:F11,G2:G11)
However, we are tasked of getting away from an Excel spreadsheet and putting this data into a database (imagine the above several hundred thousand strong).
We are using Access as a front end to SQL 2000. We need to have this conglomerate STDEV to be within Access (should the resulting STDEV fall out of spec) it will trigger an alarm for the production operator.
We are not having much success using T-SQL or Access in getting something which seems so simple in Excel. An Access query would suit our needs better.
Now, once this hurdle is overcome; there is a second phase. This table represents one of three, and, you guessed it, there is a need for a Conglomerate STDEV of ALL these points. Any help would be greatly appreciated.
View 4 Replies
View Related
Feb 10, 2008
OK so here is a working query:
SELECT Assets.*
FROM Assets
WHERE (((EXISTS
(SELECT *
FROM LCAMdump
WHERE Assets.BarcodeNumber = LCAMdump.T_TAG
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT BuildingName
FROM Building_Names
WHERE ASSETS.BuildingNameID = Building_Names.BuildingNameID)=LCAMdump.BUILDING)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.FLOOR)=[LCAMdump]![FLOOR])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.DeskLocation)=[LCAMdump]![LOCATION_SEGMENT2])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.BuildingLocation)=[LCAMdump]![LOCATION_SEGMENT1])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT FirstName
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_FIRST)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT LastName
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_LAST)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT SSO
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.LOGIN_SSO)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT UserID
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_LOGIN)
)) =False));
It works great returns the correct results. But I don't need everything out of Assets. I just need a few things from there and a few things from 2 other tables.
I tried this but it now gives back over 220 repeating results.
SELECT Assets.BarcodeNumber ,
Employees.UserID ,
Building_names.BuildingName,
Assets.Floor ,
Assets.BuildingLocation ,
Assets.DeskLocation ,
Employees.FirstName ,
Employees.LastName ,
Employees.SSO
FROM Assets ,
Employees,
Building_Names
WHERE (((EXISTS
(SELECT *
FROM LCAMdump
WHERE Assets.BarcodeNumber = LCAMdump.T_TAG
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT BuildingName
FROM Building_Names
WHERE ASSETS.BuildingNameID = Building_Names.BuildingNameID)=LCAMdump.BUILDING)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.FLOOR)=[LCAMdump]![FLOOR])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.DeskLocation)=[LCAMdump]![LOCATION_SEGMENT2])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((Assets.BuildingLocation)=[LCAMdump]![LOCATION_SEGMENT1])
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT FirstName
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_FIRST)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT LastName
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_LAST)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT SSO
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.LOGIN_SSO)
)) =False))
OR (((EXISTS
(SELECT *
FROM LCAMdump
WHERE ((SELECT UserID
FROM Employees
WHERE Assets.EmployeeID = Employees.EmployeeID)=LCAMdump.USER_LOGIN)
)) =False));
I am sure it something simple but I am a novice at this so please help me. :D
View 1 Replies
View Related
Jul 1, 2005
Please be kind, i have little VB Knowledge, and wish to expand my learning on this topic.
I have a form that updates information on one table, and has a subform displaying info from another table.
the subform is filtered, and only shows data from what is specified from the filter of the main form.
If I update information on the main form for instance,
field 1, (the data on the subform has the same data so there is the relation), how do i update the subform by only updating the mainform? can this be done through some VB or something?
if you folks out there can give a Smidget of info on which VB codes i can use i can pretty much figure it out.
like Docmd.write something?
View 2 Replies
View Related
Jan 9, 2013
is there any way to put into the calculated field (in expression builder) conditions? What I need is something like
Sum If (Table1.Field1="Y" And CurrentTable.Field2=Table1.Field3)
I means sum how many times there is "S" value in the field1 Table1, but only for records where the field3 in Table1 is equal to the value in the actual table in Field2 (in the actual row).
View 13 Replies
View Related
Aug 8, 2014
I am great with Excel but not soo much with Access 2010. I Excel, what I needed to do was very simple but duplicating what I did in Access is not soo easy.I am trying to calculate billings for FSA & HRA. I have set up one table with all the data. I want to add columns to the table to calculate:
1. Is there an account balance-excel formula:
2. If the account is still active
3. If the plan year run out is "active runout" or "runout over"
4. calculate each account type with a rate *count of FSA accounts = total to bill
Here are my excel formulas that for the life of me I can't get to work.
Account balance==IF(V2="HCRA",(IF(AB2-AD2>0,"Available Balance",IF(AB2-AD2=0,"Zero Balance","Negative Balance"))),((IF(AC2-AD2>0,"Available Balance",IF(AC2-AD2=0,"Zero Balance","Negative Balance")))))
Active runout/runout over=
=IF(AG2="YES","Active Runout",(IF(S2=W2,(IF(AF2>$AJ$1,(IF(AH2="Zero Balance","Runout Over","Active Runout")),"Runout Over")),(IF(AE2>$AJ$1,(IF(AH2="Zero Balance","Runout Over","Active Runout")),"Runout Over")))))
Active account=
=IF(D2<$AJ$1,"NO",IF(W2>$AJ$1,IF(S2=W2,"YES","NO") ,"NO"))
Can I have calculated fields that refer back to a calculated field?
View 10 Replies
View Related
Nov 6, 2012
I am creating an access database for my employer which handles blood donating at different venues. I have come unstuck with a particular request.
They would like to create 3 autofill fields for "dates", which are dependent on the previous field "Venues"
There are different venues, which are visited 3/4 times per year. This data is stored in a separate "Venues" table.
On the main user form, they would like to see the dates available to donate, when the Venue field is selected (this is an autofill box, from the Venue table). So if the London venue is visited on 1/1/13, 2/2/13 and 4/4/13. When the user types London into the "Venue" field then the next 3 cells auto fill with 1/1/13, 2/2/13 and 4/4/13.
View 6 Replies
View Related
Aug 26, 2013
I have an access form and there is a textbox in which i enter a string and have a search button so I need the onclick event procedure to search a string from my table. so how do i do it in access 2010.
View 7 Replies
View Related
Mar 18, 2014
I would like to make clickable labels on my form, so if the user has any questions about the field, clicking on the label would bring up a message box that would give them more information. I know how to write onclick events one by one for every label, but there are a lot of them, and I feel like there has to be a better way.
I put the label names, and the text I'd like for the message box in a table, and I'd like to have a module that will allow me to click on a label, and have the right text come up.
I've researched ways to do this and have come up with nothing. The farthest I've gotten is an array tied to the form open event that just displays all the message boxes from first to last, one after the other. I believe that's on the right track, but is not a workable solution as is. I need to be able to tie the message box to the actual label the user clicks.
View 4 Replies
View Related
May 27, 2014
Visual Studio IDE environment and I have been working with Access VBA for almost a year now.
I am very used to generating my form controls in runtime and being able to create some cool user interface interactions by being able to say btnExample.OnClick += MyDynamicClickFunction
MyDynamicClickFunction(Object sender, EventArgs e).... code
Any way to assign functions to the events of already made controls on a form. Probably during the load event?
Now I have found that there are many ways to replicate Visual Studio's features by accessing User32 and replicating them
View 2 Replies
View Related
Apr 2, 2015
I have a continuous subform which essentially comprises of a textbox that shows a field from a query.
The text in that box is essentially a few letters and a few numbers - what I am wondering is if I can have an on click event for the textbox, that when a user clicks the text it takes them to the record (in a different form) that matches the text contained in the textbox they clicked?
View 1 Replies
View Related