Row Source -Table/Query

Oct 4, 2006

Hi All,

This is a question that is a bit complicated to describe, so I'll try my best.

I have a form with a 'List Box' and i am using 'Table/Query' to fill the box. The table I am using is, "Department;" where it contains a list of all company's departments(Accounting, HR, Payroll, etc.). Now one thing that is NOT listed in the department table is the word "ALL."

So since I have to have this word in the List Box, so users can select "ALL" in the form, I'll have to manually go into the "Department" table to add it in, everytime I need to refresh the table with updated departments.

Is there anything that I can do VBScript code wise or in the "Row Source" in design view that I can fix this issue?

I under some might ask, how hard is it do add this in manually? Please keep in mind the 'department' list box is only one of the 5 tables that I have to refresh at least once a week, so I don't want to have to manually go in everytime to input the word ALL five time.

Thank you.

Joe

View Replies


ADVERTISEMENT

Changing Data Source (table) For A Query

Jul 18, 2006

Hi,

I have two Tables TA and TB. I have a set of queries based on TA. I want to substitute TB for TA (i.e. TB will stand in place of TA). I want the old TA queries remain unchanged but now be based on TB.

If I delete TA and then rename TB into TA, I will lose the queries. Therefore I want to 'point' the queries (in the most efficient way) to TB instead of to TA.

Then I can delete TA. Then I can rename TB into TA and the queries will follow along, I expect.

I have been trying in vain to find a way of pointing the queries to TA instead of TB? How do I do it?

I have done it with Forms (Design Views, Properties), where I can select a datasource. But where is the corresponding thing enabling me to select a datasource for Queries?

Thanks.

Adrian

View 13 Replies View Related

Changing Table Source In Query Using Vb Instead Of Manually Doing It.

Aug 17, 2004

I have a Query called Median and all it does is pulls all the fields and all the records from 1 table. Since the Query is connected to a lot of other queries, and the table it's connected to changes twice a month, I was wondering if there was a way to set this up in a form maybe using vb, so a user could maybe Click a new table from a combo box list of current tables in the database, then click a button that says "Change", and it change all the fields to the new table and removes the old table from the query.

Or what might be better is: Already on the form, i have part of the name of the new table already entered by the user (it bases the new name of the new table off this text box). So, what I can use is the Text in that box and an & " the rest of the tablename", and automatically change the table in the Median Query based on that criteria. If that is too complicated, then a combo box will be sufficient.

Another way i guess, would be to setup a hidden field that takes whatever's in my text box (which is a date) and adds " the rest of the tablename", then I could base the replacement table of the Median on that one text box.

Anyway, is there a way to do this?

View 6 Replies View Related

Changing Data In Query Results Changes Data In Source Table

Dec 17, 2012

I have a table and a simple query that pulls results from the table. Nothing too crazy. But, if I were to go in and change some of the data/values in the query results it will change the respective data in the table. I know that this cannot be right. What do I have to do to either prevent the ability to change query results and/or prevent any changes in the query from altering the original data in the table.

View 2 Replies View Related

Queries :: Access 2007 - Insert Into Table Where Source Is Another Table And Form

Feb 3, 2015

If you want to use a "DoCmd.RunSQL "INSERT INTO" command to insert data in a table and the data to insert comes from a table and a form, could this be done in one pass?

So...writing a record wit 4 values from table1 together with a additional value from a textbox in table2 as 5 values.

View 5 Replies View Related

Modules & VBA :: Update Access Table From SQL Server Table Source

Jun 17, 2013

I have created a code below to test whether I can run a query and retrieve a data from an SQL server table. And so far I can return the result using a messagebox. but somehow I just don't know how to use this connection to update the table inside this access file. Basically I want to use this as a front end file. then when the form is open it will automatically update the table inside this access file and load the data to the combo box as a list.

Code:

Option Compare Database
Sub LocalServerConn_Test()
Set conn = New adodb.Connection
Set rst = New adodb.Recordset

[code]....

View 4 Replies View Related

Queries :: Append A Field In Destination Table That Is Not In Source Table

Oct 9, 2014

I have a fairly simple append query that appends two columns of data to another table - all good. Except, the destination table has a field 'ServiceDate' that I would also like to be completed at the same time with today's date. I presume that this is =Date(), but where do I put it to make this happen?

View 2 Replies View Related

Table Lookup - Row Source From Another Table - Only Showing Numbers

Feb 11, 2012

When I have a 3rd table looking at the row source of the 2nd table, which is looking at the row source of the 1st table. I only get numbers.

Everything I have read so far points to using a query as a solution. However, the query I made is not updating the information from the 2nd table.

I have attached a few examples.

Attachment 6247

this below shows. I changed "Bakersfield-test1" in the original table. However, the query I made does not update, still showing "Bakersfield-test". When you click on the drop down, it shows the updated "Bakersfield-test1", but it does not repopulate my column with the updated info from the table.

Attachment 6248

View 4 Replies View Related

Remove Record Source/Control Source

Sep 19, 2005

I have an unbound form with three tabs. On each tab there is a sub form. Each tab is a search form and each sub is a results returned. I have made everything unbound and set the sub form recordsource and its controls control souce on afterupdate of the main form search criteria. Works fine except for after some use the db decides the sub forms are not unbound and sets the record source and control sources.

I'm trying to do a

Me.PollingPlacesResults.Form.RecordSource = ""
Me!PollingPlacesResults!PollID.ControlSource = ""


but this does not seem to work in actualy removeing the record source and control source.

View 14 Replies View Related

Change Source For Linked Table

Jan 24, 2008

I have a linked table and want to change it's data source to another table entirely -- ie: different file name.

Can this be done with linked tables, or can you just link to another file with the same name but in another directory? If linked tables have this limitation, how would you accomplish what I'm trying to do. I want to keep the same name for the linked table.

Ultimately, I want to populate a listbox with the different files in a directory and change tblSource to point at the chosen data source.

Thanks,


Randy

View 3 Replies View Related

Control Source And Populating Table???

Mar 25, 2008

Hi Guys

Im really confused on what to do

Basically I have a form, and inside that form there is the "Total Cost" field which is a field in the "tbl_Transactions" table; to display some values from a subform inside of the "Total Cost" field i changed the control source of the "Total Cost" text box to the fowllowing expression:

=[Forms]![frm_Transaction]![frm_ProductReceipt].[Form]![Cost]

But obviously because of the fact that the control source has been changed these values brought up by the expression are not put into the table so the "Total Cost" column in the transactions table (tbl_Transactions) is just blank.

Is there any way I can make it so that the values drawn up by the expression will also be entered into the " Total Cost" field in the transactions table as well as being displayed on the form?

View 2 Replies View Related

Updating Table From External Source

Sep 10, 2007

Dear Forum,

I have a question and I would be very happy if you could help me with some thoughts on how to start.

I have a database, which contains one table tbX, which ist interesting in this context. tbX needs to be updated on a regular basis, hence it would be very helpful to automate this process.

Source is the table tbY, which is located in another database in a different directory. What I am looking for is basically a query (or do I need a macro?), which deletes tbX, imports tbY and changes its name to tbX.

As there is no macro recorder like in Excel I find it very difficult to find a start here... :confused:

I'd be happy for any suggestion.

Thank you.
Diana

View 3 Replies View Related

Forms :: Using Certain Table As Control Source

Aug 7, 2013

I have a form that uses a certain table(tblDetails) as the control source and within this form I have 3 combo boxes. One combo box looks up a company name from another table and I was wanting my second combo box [LastName] to have its look up list based off of the first combo box choice.

Form= tblDetails

Combo box(Company)- pulls from the tblContacts

Combo box(LastName)-pulls from the tblcontacts

Combo box(FirstName)- pulls from the tblContacts

All info is entered into the tblDetails.

View 14 Replies View Related

Queries :: Opening Design View Of Append Query Without Timing Out Source Query

Mar 4, 2015

In some cases I create pass-through queries and use these in an Append or Make-table query to bring data locally.

All is well and fine until source data changes and the pass-through query runs too long and times out.

If needed, I can extend the timeout value in the Parameters of the pass-through query no problem, but when I try to open the Append or Make-table query in Design view to do the same, the pass-through query is first triggered and then throws the timeout, and I cannot access the Design view of the Append or Make-table

Is there a way to open an Append or Make-table query in Design view without invoking the source query?

View 1 Replies View Related

Queries :: Crsosstab Query Doesn't Recognize Expression In Source Query

Aug 12, 2015

I have a query where these are the fields:

ProductRevType
RevLag
RevFlowThru
CloseMoYr
ProjRevDate
CurrentMRC
ProjRevMRC

The ProjRevMRC field is an expression that reads:ProjRevMRC: IIf([ProjRevDate]>=DateSerial(Year(Date()),Month(Date()),1),[CurrentMRC]*[qry303a_ SFADetailMRC_ONLY]![Rev Flow Through],0)

When I run the query, it works perfectly, but when I created a crosstab query to show totals by month, I wanted the totals to be zero for the months less than the current month. Is there a way for the crosstab query to execute the expression and put zeroes for those months?

View 4 Replies View Related

Queries :: Query Error When Data Changes In Crosstab Source Query

Aug 12, 2014

I have a database which among other things records how jobs are received i.e.: Telephone, Email, Mail, Facsimile or Web.For each client I want to identify the percentages of each method of receipt against the total of jobs received and during different time periods.I have created a make table query for all jobs received between variable dates for a client entry of the name of the client and the start and finish dates are required to run the query.

I have a crosstab query set up to count each method of receipt and a final query to work out the percentages using the total from the crosstab query fields divided by the total of all methods.I have a macro set up to replace the table with new data when I want the stats for a different client between new dates, therefore the different methods of receipt may vary for the less active clients i.e.: they may only have telephone and email .

My problem is if I choose a client where we have not received a job by a particular method (say web or facsimile), the last query working out the percentages has fixed names to cover each method but naturally produces an error when it cannot find a corresponding method of receipt. I have experimented with NZ() without success.My question is can I either have preset standard names of the column field in a crosstab query? Alternatively in the query calculating the percentages, can I include code to ignore a non-existent field in the crosstab query.

View 9 Replies View Related

Modules & VBA :: Return Name Of A Record Source Table

Feb 19, 2014

I'm new to Access and VB but I managed to write parts of what I want access to do.By tweaking a code I found on the internet, I managed to write a small Subroutine that allows the user to click on one of the fields of a record in a report and then Access opens the form on that specific record.*My code goes something like this:*

Code:

Private Sub Edit_Click()
* Dim strWhere As String
* Dim DocName As String
* DocName = "FormName"
* strWhere = "[Field Name]='" & Field & "'"
* DoCmd.OpenForm DocName, acNormal, , strWhere
End Sub

Now I want to get the name of the Table where the record exists.So, let's say when I click on the "Field" it gets the name of the table where the record with that field exists and sets it in a variable.OR even better would be, get the name of the Form where that record exists but I guess that's a little more complicated since the record is directly linked to the table...*

View 14 Replies View Related

Queries :: Cannot Locate Source Of Table References

Feb 24, 2015

I have a database I took over, that generally uses linked tables to a MYSQL servers on another machine. The Access database uses a machine DSN to connect.

There are many queries that contain references to linked tables using another name. For example, the table is "service unit" but the queries are using "SU" as a reference. I cannot find any database object with that name SU. There are many such tables referenced like this - all uppercase letters, which is a common thing they all share.

Now, the server had a file integrity issue, and now the queries that contained the SU references will not work anymore. I created a linked table and called it SU and but the queries still won't work until I edit the queries, remove the old SU table, and add the new one in. So,

1. Where those table references could have come from, if it's not a linked table? Is there a hidden location on the server, or in the access database that stores another connection method?

2. Why won't simply adding a similarly named database object work the same way? Why must I re-edit all the queries?

View 1 Replies View Related

Forms :: Separate Table For Each Combobox Source?

Apr 8, 2015

I suspect I have made a beginners mistake in my very first Access database, but before I start this again from scratch, I would like to know if it is really a mistake, or if I might easily fix it somehow.

I have a form with several combo boxes.

All the source fields for those comboboxes are in one table. But of course every field has a different number of cells containing content. Now when I open a combobox in a form, the sequence of the cells are a mess, and there are lots of empty lines for many of them. (probably also because I reordered some fields in the source table)

I now have no clue if I can crop the combobox dropdown output somehow so that each combox only shows cells with content. (and preferably in a defined order)

Should I have started with creating one different table for every combobox, and not trying to put all the source fields in one table?

View 7 Replies View Related

General :: Using Table As Control Source For Dropdown Box?

Apr 6, 2013

Is it possible in access 2010 to create a table "Kits" with 4 columns: kit, lot, expire_date, in_use.

Then in a form use that table as a control source for dropdown box? However, if in the table in_use is "No" then that row is not a choice?

View 3 Replies View Related

Form - Record Source - Select A Table

Nov 13, 2013

Form - record source - select a table that when the user enter a value in the field of the form it gets place into the designated table (select a table). my problem is that I have two fields in the form, one field from the data entry is suppose to go to the train table,and another field the data entry is suppose to go to the station table. if I have the form's record source have a designated table for the data entry.It doesn't have two tables for the data entry.

View 13 Replies View Related

Finding The Source Of A Linked Table To A Front End Database

Dec 17, 2004

I have been working on quite a few multi user Access projects in the past few months with a backend and a front end which has linked tables.

I would like to know if there is any way to find out the source of a table linked to the front end and where would its location be on the network.

View 3 Replies View Related

Populate Textbox With A Field From Another Combo Box's Row/source Table

Jul 18, 2005

I've designed a data entry form based on a table. I use a few combo boxes, (linked via SQL statements for their row/source) to fill most of the fields in the table.

What I want to do is populate one textbox on the form with the contents of a field in one of the combo box's row/source tables. The field I want isn't shown in the combo box.

Basically, what I want is that when I choose a PART NUMBER from a combo box, I want the OEM_ID from the same table to jump into the textbox below it.

I think I may have tied myself in knots though to the point where what I want can't be done. Any ideas? I know this is probably going to take a couple of goes at explaining. :P

View 11 Replies View Related

Need Help With SQL Query For Row Source

Feb 13, 2008

Hi!

I have those (simplified) tables that are linked with an n:m relation

persons:

#ID#FullName#

trainings:

#ID#startDate#

training_members:

#ID#trainingID#personID

Now I created a form to fill the training_members table with the participants. For the form I'm using a dropdown list filled with the names of the people from the persons table. What I now want is that the dropdown list only shows the values that are not already used before. So I changed the SQL statement of the row source property:

SELECT persons.ID, persons.FullName FROM persons WHERE persons.ID Not In (SELECT personID from training_members inner join trainings on training_members.trainingID = trainingsn.ID) ORDER BY persons.FullName;


I also added "me.recalc" to the after_update event of the dropdown list.

It does work - but there's one problem left: The SQL query doesn't include the just selected value. Because only values that are included in the list are accepted, the name of the person isn't shown in the dropdown.

Do you know how I can update the SQL statement so that the just selected entry is as well mentioned in the list? The abovementioned form is displayed as "Continuous Forms", so I don't know if it is possible to access the recordset the dropdowns are located into...

Thank you in advance!

View 1 Replies View Related

Multiple Source Query

Jun 26, 2006

I'm in the process of learning to use Access and I would appreciate any help that can be provided. The problem that I am facing is that I have data in three different columns, and this cannot be changed. The database that I am creating links to another database to retrieve a table. This table contains two columns of data that are essentially the same for my purposes. I have also created a new table in my database which houses new data and also this will be the location where new records are be stored. Ideally what I'd like to have is a single table with the information from the three sources stored in a single column that updates as the linked table is changed. Is there a way to do this with a query? or should I be looking into another method? Any help is appreciated. Thanks.

Would the append option be appropriate?

View 3 Replies View Related

Query As Report Source

Aug 11, 2006

Hi

I have o form based on a query that I can search in for last name etc.
And then I have a button for opening a report for the person that displays.

Here is the problem now:
If I have two persons with the same last name I get a report of several pages also showing the person that is not displayed in the form but have the same last name.
What can I do in the query just to get the person only on display showing on the form?
ID is the primary key

Mikael

View 1 Replies View Related







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