Forms :: Dynamically Selecting A Lookup Table To Update

Apr 7, 2014

I have several lookup tables in an Access database. These tables are used to populate fields in the main table and act as filters for viewing record subsets.I want to create a form that does the following:

1.) List the lookup table via a combobox.I was able to accomplish this with the following code:

Code:
SELECT MSysObjects.Name AS [Table Name]
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "tblJob*") AND ((MSysObjects.Type)=1) AND ((MSysObjects.Flags)=0))
ORDER BY MSysObjects.Name;

2.) When a table is selected from the combobox, display the table in a subform for updating.

View Replies


ADVERTISEMENT

Update Textfield Dynamically

May 8, 2006

I have a database that has a field [country] that stores the numerical id of the country from a table of countries. The student table also has a field called [mother tongue] and it seems to me that this is duplication.

I created a simple query based on a link table that tells me the country and its associated mother tongue.

SELECT [-LOOKUP-ALL-Country-LinkToMotherTongue].Country, [-LOOKUP-ALL-Country-LinkToMotherTongue].MotherTongueLinkNo, [-----LMotherTongue].Language
FROM [-----LMotherTongue] RIGHT JOIN [-LOOKUP-ALL-Country-LinkToMotherTongue] ON [-----LMotherTongue].[Reference no] = [-LOOKUP-ALL-Country-LinkToMotherTongue].MotherTongueLinkNo;


It seems to me to be an overhead to store in the student table the mother tongue id.

How can I create a text lable that dynamically shows the mothertongue as i move over records?

that way the user can see the students mother tongue but I only store the country table and link table to mother tongue. as opposed to a mother tongue entry against all students.

regards in advance
Peter

View 2 Replies View Related

Dynamically Update Combo Box

Jan 26, 2006

Hi, I am new to asp development and have been searching all through the web and books to help me but I am a little stuck and would appreciate some help please with updating a second combo box.

I am developing an online fault logging system for a school where the teachers/pupils can report a fault with any computer equipment to the technicians so they then can fix it.
I have two combo boxes called ResourceType and Resource ID which are created and populated from two different tables in an Access database (I dont want to annoy you with the code but if you like I can show you)

When ResourceType combo is selected it should automatically update the ResourceID combo from a table in the database. eg. ResourceType=Laptop then ResourceID should be populated with all the entries in the DB which correspond to Laptops, i.e. Laptop001, Laptop002 etc.

ResourceType combo is populated from table tblResourceType in the Db and ResourceID is populated from table tblResourceID. This works fine when the page is first loaded but I have problems with the onChange="handleChange(this)" function for the ResourceType combo. It is :

Code:function handleChange(nSelection){var IDSelect,iCountIDSelect = document.form.ResourceID //Reset the ResourceID combo contentsfor(i=IDSelect.length; i>0;i--){ IDSelect.options[i-1] = null} //Open Database<%set db=server.createobject("adodb.connection")db.Open"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("MCB Fault Log.mdb")dim dbaseset dbase=server.createobject("adodb.recordset")%> <%Dim iCount 'counter variablesSQl = "SELECT ResourceID from tblResource"dBase.Open sSQl , db%> //Reset Counter iCount = 0<%do while not dBase.EOF%> IDSelect.options[iCount] = new Option(<%=dBase("ResourceID")%>);//********This does not work****** //IDSelect.options[iCount] = new Option(iCount);//***HERE**This works (places the count of each record in the combobox iCount = iCount + 1; <%dBase.MoveNextloop%>}
Dont worry about the SQL statement for now, I am happy just for any table to fill into the combo. Look at the //********This does not work****** line - I think I have the syntax wrong, I have looked at lots of examples on the net and I cannot find one similar to this. The line ***HERE** places the number of the count into the combo box so at least i know the the database is being accessed.

Does anyone know what is going wrong here.

Thanks in advance for any help you may give

Cush

View 1 Replies View Related

Forms :: Selecting A Table To Be Populated Using Cascading Combo Box

Aug 6, 2013

I am trying to use a combo box to control which table a data entry form will write data to. I want to create a form that has a combo box to select from a top level table that I will call "Stores". Once a "Store" is selected from the drop down, the next field on the form will be a data entry field. The data entered in that field will be written to the table selected by the preceding combo box.

So, basically I would have say Wal-Mart, Macy's, Sears, K-Mart and etc, listed in my "Stores" table. Once I select one of the stores from the drop down, I would then enter a "department" name in the data entry field and based on which store I selected from the previous combo box, the data would be written to that stores department table (which each store will have its own department table), e.g., WalMartDepts, MacyDepts, SearsDepts, etc...

View 1 Replies View Related

General :: Ability To Dynamically Update Multiple Docs / Files

May 31, 2013

Lets say we have 100 documents. 30 of these documents contain the same exact set of instructions that i want to update/change. what options would i have that would allow for this 'mass update' so that i can change that specific instruciton and every document with that line would be updated to reflect it?

View 4 Replies View Related

Forms :: Lookup A Value In Another Table?

Oct 8, 2013

on a subform i want to lookup a value in another table (which I do using a combo box) then i want it to auto fill in the description in a txt box, and save that information in another table.

How to do?

View 6 Replies View Related

Forms :: Store Lookup Value In Table

Sep 9, 2014

I have form with student details on it and I want to add some additional information against that student (stored in a seperate table). I've created a form to input the data and a button on the main form to open the new form.

On loading the form I've brought with it the name of the student but I also want the UPN. I've done all the above fine.

What I need to do is then store the UPN in a field in the new table which is where I'm stuck.

What do I put in the Control source to make it store it. Currently I just have

=[Forms]![PupilPremiumStudents]![txtUPN]

View 9 Replies View Related

Forms :: Using Same Lookup Table For Different Fields

May 27, 2013

I am developing a database for a school and I have a form for staff addresses where the city is a drop down box that auto fills the state and zip according to the data in the lkuptblCity. All is working fine EXCEPT we have an Address 1 and Address 2 field for the employees.

I have two separate fields in the Staff table to store the data, as needed for reports. I have two separate fields on the form but they will not work due to pulling from the same table.

View 1 Replies View Related

Forms :: Lookup Table To Populate Combo Box?

Sep 2, 2014

I'm using a lookup table to populated a combo box on my form. I use a provided list of input strings (hundreds) in my combo box and the list is provided in all caps. How can I convert these provided words (strings) to first cap from either the quarry level or form level.

View 1 Replies View Related

Forms :: Address Lookup From Predefined Table

May 15, 2013

Have been searching for a way to allow an address to be looked up from a predefined table.

What I am looking for is that the user can type just part of the address into say, a text box, and are presented with all options which match so that they can chose the correct one. Once chosen I want the form to be populated with one or more fields from the selected record in the address table.

View 2 Replies View Related

Forms :: Using A Lookup Wizard To Select Multiple Entries From A Table

Jul 14, 2015

I am trying to create a lookup wizard to record the number of people who attend a regular event. I have a table recording the names, surnames and DOB of registered members and a number of other tables for regular events we hold. Previously people have been manually adding the names of attendees and of course there have been inconsistencies in the data. I want them to look up the names from the table of registered members. I have been using the lookup wizard, but it is only displaying the first name in a string. I need it to display id, first name, surname and DOB in a table. I also want to be able to type in the first letter and then pick from the list.

View 5 Replies View Related

Forms :: Lookup With Values From Another Table - Populate County Once Zip Code Entered

Mar 22, 2013

I want my form frmintake to lookup with values from another table and populare county once the zip codes has been entered.

I have a table called tblintake and another tblcounty.

tblintake has zip codes entered manually

tblcounty has zip codes and counties for all regions

how does this work out in dlookup.

=DLOOKUP[Zip Code],[tblCounty],[zip Code]=[County])

View 1 Replies View Related

Update A Form By Selecting From A Combo Box

Apr 13, 2005

I have an unbound combo (because it is synchronised with another unbound combo box) box that selects a record, but I can not get it to update the rest of the form to show the required data.

The form looks up project data from 3 seperate tables which are all linked by relationship.

What do I need to do to make this work?

Thx for looking.

View 2 Replies View Related

Dynamically Update Field Of A Current Record Based On Previous Record

Apr 30, 2007

I need a way to dynamically store a particular value in "field_2" of the CURRENT record depending on whether or not the value of "field_1" of the CURRENT record is identical to the value of "field_1" of the PREVIOUS record within the same table. The table is sorted on "field_1".

So, if the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is also "ABC", then store a value of "PPP" in "field_2" of the current record. IF on the other hand, the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is "XYZ", then store a value of "WWW" in "field_2" of the current record.

I have a report that will use these results to count only the number of records that have a "WWW" in "field_2".

Is this doable, maybe in a query somehow?

I should add that whatever the solution, it needs to be compatible with Access 2000.

View 1 Replies View Related

Dynamically Creating MS Access Table

Feb 5, 2008

Hi,

I am trying to create a series of MS access tables from within a SQL 2000 DTS package. The names of the tables reflect the date range of the data within them. Creating the "Create table ddmmyy ...." statement isn't a problem (full code below), but doesn't run as it creates a Jet error - "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. Does anyone know if what I'm trying to do is possible.

Before anyone suggests it, yes I have posted this on SQL server forums.

declare @TheName char (8)
,@Cmd char (500)

select @TheName = (select max(LastRunDate) from NSP_Analysis_Dates)

select @Cmd = 'CREATE TABLE `NSP_Analysis_' + @TheName + '` (`TYPE` VarChar (200) NULL, `VENDOR_NO` VarChar (10) NULL, `VENDOR_NAME` VarChar (50) NULL, `AMOUNT_CLAIMED` Currency NULL, `REGION` VarChar (100) NULL, `CLUSTER` VarChar (100) NULL, `PLANT_CODE` VarChar (15) NULL, `PLANT_NAME` VarChar (50) NULL, `DATE_OF_SERVICE` DateTime NULL, `STATUS` VarChar (200) NULL, `TICKET_NO` VarChar (20) NULL, `NOTES` VarChar (255) NULL, `DATE_ENTERED` DateTime NULL, `AuthorisedByName` VarChar (50) NULL)'
sp_executesql @Cmd

View 1 Replies View Related

Dynamically Associating A Pivot Table !!

Oct 30, 2006

I have a pivot table, It is associated with a table in an another database (access database ofcourse!). What I am doing is that I am inserting new data on a click of a button in that table but the pivot table shows the same old data, it does not refresh..!!

How can I do that??

View 5 Replies View Related

Unable To Update A Field In Record In My Form After Selecting From Comboox.

Apr 25, 2005

Trying to update a field in a record in my form after selecting from a comboox.

This an orders form with a record per row for order items. I select the product from a dropdown list which is populated by a dynamic query from the afterupdate event on another combo. When I do the selection access reports the following error:
Runtime error 3331
to make changes to this field, first save the record


Debug takes me to the line :
Me!product_id = DLookup("product_id", "products_table", myvar)
from :
[code]
Private Sub comboProd_description_AfterUpdate()
Dim strFilter As Integer

comboProd_description.Value = comboProd_description.Column(1)

myvar = comboProd_description.Column(0)



Me!product_id = DLookup("product_id", "products_table", myvar)

[end code]

I'm lost as to what to do (no such thing as beginners luck!!). I'm not even sure if the error is from the combo box or from the field that it is trying to update (product_id)

Thx for looking

Kev.

View 1 Replies View Related

Forms :: Dynamically Resizing Forms And Controls

Oct 31, 2013

I am making a database that will be used by multiple people on a network, and they have different resoloutions on their own computers. when the database is loaded on their respective computers, the form controls are all off.

On the computer i designed them on, the forms fit perfectly on screen, as do the controls, i would like to know if there is some vba code i could incorporate into the form open event, or module code that i can use in order to dynamically re-seize the forms and all of the controls to suit different resoloutions?

View 6 Replies View Related

Dynamically Generate Content On Forms

Apr 10, 2006

Hi,
Does anyone know of a way to dynamically fill the content of a form at runtime. I want, for example, when a user clicks a button, a textbox is dynamically added (but I would prefer not to use hidden objects). I've tried the "CreateControl" option but I can't seem to get this to work. Any coding examples would be much appreciated.
Thanks,
Mark.

View 4 Replies View Related

Forms :: Dynamically Changing Captions

May 20, 2015

I have a system that has a growing number of forms. On each form they are a variable number of labels/text boxes/command buttons etc. The captions for all of these are in english.

The database is to be deployed to a non english speaking country so I want to be able to dynamically change all the captions on the forms (not n the data) to the local language.I know how to do this. For each control on load I decide the local language and change the caption accordingly ie (and code is for illustration only and not necessarily syntactically correct)

if locallanguage = 1
me.control1.caption = "save in english"
me.control2.caption = "heading1 in english"
else
me.control1.caption = "save in local language"
me.control2.caption = "heading1 in local language"
end if

What I want to know is there and easy way to do this. Rather than wade through each control on each form and find out what the name is can I generate anything that will give me all the control names and captions for each form (and report)?

View 14 Replies View Related

Setting A Filter On Dynamically Created Table?

Apr 23, 2015

I am currently working on a Database to automatize some process.

The User can import a CSV (Text) File via a DialogBox, which gets imported into a Table. After this, the content has to be filtered, setting conditions on 4 different rows. The new Table gets exported into a new CSV (It has to be CSV, since it later gets imported into SAP)

How can I set a Filter on a dynamically created Table (using VBA)?

Best case would be to save the filter into my Import spec, but Access doesn't seem to have this option (?)

View 3 Replies View Related

Update A Lookup Feild

Apr 20, 2006

I have a table (tblStudent) containing a field named fldTeacher1. Looking at the properties of fldTeacher1 I see that it has a lookup:

Bound Column: 1
Column Count: 2
Column Widths: 0";1" (id number; teacher's Name)

I am trying to run a DoCmd.RunSQL command in code and My question is how do I write a sql statement in code that updates that field with a new value?

I have tried:
DoCmd.RunSQL ("UPDATE tblStudent SET fldTeacher1 = " & Val(txtID) & " WHERE fldID = " & gintStudentID & ";")

All it does is place the id # in the field and not display the teacher's name in fldTeacher1 after the command was run.

View 1 Replies View Related

Update A Lookup Field

Apr 20, 2006

I have a table (tblStudent) containing a field named fldTeacher1. Looking at the properties of fldTeacher1 I see that it has a lookup:

Bound Column: 1
Column Count: 2
Column Widths: 0";1" (id number; teacher's Name)

I am trying to run a DoCmd.RunSQL command in code and My question is how do I write a sql statement in code that updates that field with a new value?

I have tried:
DoCmd.RunSQL ("UPDATE tblStudent SET fldTeacher1 = " & Val(txtID) & " WHERE fldID = " & gintStudentID & ";")

All it does is place the id # in the field and not display the teacher's name in fldTeacher1 after the command was run.

View 2 Replies View Related

Lookup And Update Data????HELP

Feb 24, 2007

i want to update data fields (time fields) in a table based on a number input by user (so it will search for record in table using the number and then update the relevant fields)....How can i do this am quiete confused there PLEASE DO HELP

View 1 Replies View Related

Forms :: Adding Page To Tab Form Dynamically

May 24, 2013

I would like to add a page to a tab form when a certain button is clicked. I don't want to use the visible/hide solution. So I already found out that this can only be done in design view. I am using the following code:

Code:

Private Sub cmd_StrategyAdd_Click()
DoCmd.OpenForm "Form1", acDesign
Me.tabMain.Pages.Add
DoCmd.OpenForm "Form1", acNormal
End Sub

I am getting the error: Run-time error 2467. The expression you entered refers to an object that is closed or doesn't exist.I am sure the name of my tab form is tabMain.

View 14 Replies View Related

Forms :: Dynamically Search Multiple Fields

May 13, 2014

Im trying to make a find page that looks up 7 fields and after reading about the Dynamically search multiple fields i downloaded the sample and changed a few things. But I have a few problems .

1) If you open the FRM_SearchAll from the navigation pane , it will not show the detail form by dbl_click or view button also will not show the picture .

2) If you open it the navigation form , it has the following error
Forms!FRM_SearchMulti!SrchText before you start it.

3) As above it will not show the detail form by dbl_click (it has Error)
Run time error : 3075
Syntax error (missing operator) in query expression '[Food]Snack a Jacks'.

4) If you try to view detail form with the button (the error comes up)
Syntax error (missing operator) in query expression '[Food]Snack a Jacks'

5) also will not show the picture .

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved