Combobox = FieldName

Dec 13, 2007

I am trying to create a query that can be customised by a combobox.

I have a combobox that lists the fieldnames from table (rather than records)

I want to be able to run a query that updates the field selected from combobox with the vaule from another txtBox

What I want to be able to write in SQL is;

UPDATE Products
SET [Forms]![Master_Form]![Combobox] = [Forms]![Master_Form]![Qty]
WHERE (((Products.ProductName)=[Forms]![Master_Form]![ProductName]));

But of course this does not work.

Any help would be appreciated in SQL or VBA?

View Replies


ADVERTISEMENT

Queries :: SUM Of Fieldname Holler When Fieldname Area Has The Same Value

Jun 26, 2015

I have got a query which gives me the following output;

Nr ----------- area ------- area 2 ---------- holler
14-1096-------1------------1-----------------5.9
14-1097-------2------------2-----------------7.8
14-1100-------1------------1-----------------13.4
14-1101-------2------------2-----------------7.8

What i would like to do is to calculate the sum of holler when they are in the same area.So the sum of nr 14-1096 + 14-1100 and 14-1097 + 14-1101. Ive tried to do the following;I tried to do the following just to check it would even work;

Code:
test: (SELECT Sum([holler]) FROM querytoetsn2hr_gemiddelde_filter WHERE ((querytoetsn2hr_gemiddelde_filter.area)=("1")))

Which worked perfectly, it gave me 19.3..

Code:
test: (SELECT Sum([holler]) FROM querytoetsn2hr_gemiddelde_filter WHERE ((querytoetsn2hr_gemiddelde_filter.area)=(querytoetsn2hr_gemiddelde_filter.area2)))

That gave me the sum of all 4 the Nrs. Which makes sense, because you basically say that as long as area and area are the same calculate the sum of holler.if there is a way to say "sum of holler when area has the same value".

View 2 Replies View Related

!Nz(!Fieldname)

Mar 1, 2007

I ahve in error typed the above - however it compiles and compacts and repairs without throwing an error. Should this be spotted before I actually run the line of code??

Ta

View 10 Replies View Related

SetFocus On A Selected FieldName

Apr 24, 2005

I have a form with numerous fields and would like to be able to move the focus to a selected field by typing the field name into a control box. How can I do this? TIA

View 4 Replies View Related

Forms :: Using Variable As Fieldname?

Aug 8, 2013

I have a form with 48 unbound text fields name txt1 to txt48.

These are to represent 24 hrs in half hours, to visually represent the hours capacity of my workshop. Now if I choose a date, which is say Monday, I check my settings, and see that the workshop has a capacity of 15 hrs on a monday. Now I would like to in a loop set the backcolour of the remaining fields to red.

Something like for I = 15 (workshop capacity) to 48

me."txt" & I.backcolour=1111
next I

View 3 Replies View Related

Report, Subreport, Query, Fieldname

Mar 5, 2006

I have a report named rpt100 with two subreports srpt100a and srpt100b. The subreports are based on query qry100a and qry100b. Both queries are based on tbl100. I removed a field named 'Comment' from tbl100, as it wasn't useful; Also removed the fieldname from both qry100a and qry100b. When opening rpt100 a parameter dialog opens asking for data on the deleted fieldname 'Comment'. The field 'Comment' was never used in the report or subreports.

Inspection of the subreport fieldlist shows field 'Comment' still present.

How, other than remaking the rpt100 and both srpt100a and srpt100b, do I remove the field 'Comment'?

Gunner...:confused:

View 1 Replies View Related

Build A Dimensional Fieldname In A Query

Feb 20, 2008

As example, I have a table with an Item number, introduction year and a number of historical and future Sales periods set per year, these sales columns are listed Y1990, Y1991, Y1992....... Y2015.

Based on each items introduction year, I want to list the first 5 years of sales.

I wanted to create a dimensional fieldname eg: FirstYear: "Y"&[introduction year] to get the value of that respective year. (I currently just get a text saying "Y1995", and not the content )

Any help is appreciated!:)


(Note: I can't transpose the data in the tables for other reason)

View 3 Replies View Related

Reports :: DCount With String For Fieldname?

Jan 22, 2015

Access 2010 report. I am trying to use DCount but have a string for the fieldname and cannot figure out the correct syntax. This is what I have tried:

txtMiscYes1 = DCount("[" & str1 & "]", "tblTemp", "[" & str1 & "]" = '1')

I want to count any answer that has a 1 and skip a 2 or 3 answer.

View 5 Replies View Related

General :: Variable As FieldName In DLookup

Aug 12, 2014

I want to use a variable as FieldName in the DLookup function.

Normal DLookup:

Code:
DLookup("FieldName" , "TableName" , "Criteria= 'string'")

I want to use:

Code:
DLookup(variable, "TableName", "Criteria= 'string'")

Where variable is an integer, which represents the column number in the table.

Is this possible?

View 7 Replies View Related

General :: How To Change FieldName Globally

Oct 16, 2012

I have a database where I would like to change a fieldname to something different.

I know I can use edit replace in the code and that works ok, but is there a way to change the fieldname in the code, the Table, the queries, and sql all in 1 foul swoop or do I have to do them all seperately by hand.

View 3 Replies View Related

Data Is In Me![fieldname] But Doesn't Get Stored In Table

Apr 22, 2006

Hello all :)

I've read some really funny stuff while searching for an answer to this. You're a bunch of really witty types :)

So I'm sure someone can help me - why would this entered data not make it into the table?

I have a form that has a subform. After the subform I have a button to continue. If this is clicked I change the visible property for another field to true. This field appears to work fine, but the data doesn't make it to the underlying table, in fact it sometimes seems to be included in the next record.

Any ideas?

Thanks
A.

View 4 Replies View Related

Modifying Query Fieldname & Criteria Thru Code

Nov 30, 2004

Hi,
Self learning trying to modify a query fieldname and criteria thru code.

Have a small form with a button making a copy of a query/s (eventually making about 50 copies).
Once these have been made, would like to open the query up, which I can do, then modify both
the fieldname and the field criteria to suit my needs from parameters set in the form.

How do I do this if it can be done ?

Thanks in advance

Ian T

View 3 Replies View Related

Query Field-heading Format: Tablename.Fieldname?

Nov 30, 2006

Im running a query and normally there is only a field-name in heading. I have
multiple tables with equal field names. Now I want to get table names in
heading too (Tablename.Fieldname) so I can make difference between fields on each tables when previewing query. Is this possible in access? I don't want to change all field-names manually, I know it's possible and done easily, but there are almost hundred fieldnames...

Im finding a solution. Help me please. Thanks :eek:

- Roger
--
Have a nice day.

View 1 Replies View Related

Control Can't Be Edited; It's Bound To Unknown Field 'FieldName'.

Apr 10, 2007

Hey guys, I am trying to input data into a form, the form consist of mulitiple tables. Once I set it up I get a "#Name?" error in the text box, and when I try to input data into the text box, at the bottom of the form it keeps saying "control can't be edited; it's bound to unknown field 'FieldName'."

Can anybody help me with this problem?

Thanks

View 8 Replies View Related

Quick Question: Autocorrect Option (updating All Reports & Queries W New Fieldname)

Dec 22, 2005

Hello friends,
I am having trouble displaying or updating data through all my subforms.

So im just trying to isolate the issue,
I went into my table definition and changed fields named with seemingly reserved keywords as follows:

name = personName
userId = personId

Now, i have hundreds of report and queries based on these tables (3+) with these fields. What do i need to do to automatically update my reports and queries without going into each one to manually update :eek:

Is that what the autocorrect option does? I have been advised to always have it turned off as it causes database corruption.

So how do i update my all things with these field name change.
Any suggestions, comments would be greatly appreciated :)

View 8 Replies View Related

Forms :: Update Row-source Of Combobox Based On Value Selected On Another ComboBox?

Apr 26, 2015

I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.

Code:

Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub

But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?

View 5 Replies View Related

Saving Contents Of Combobox As String, And Inputing In Another Combobox

Jan 13, 2005

How would I modify multiple comboboxes in subforms at the same time. For example.. In main form ComboboxA user selects 1992, Combobox1 in subform1 is also changed to 1992, as well as Combobox2 in subform 2.

Whats the best way to do this?

View 2 Replies View Related

How Can I Filter One Combobox Based On Another Combobox Selection?

Apr 22, 2005

I have 2 comboboxes, the first one is called "activity", whereby I have 3 options to choose from, and the second is called "level".

When I click an "activity", for example Drawings, I want the "level" combobox to list a unique set of options for that category. and if I click on a different "activity" for example Planning, I want the "level" combobox to show a completely different set of options.

If anyone can give me any help on how to do this then I would be very grateful!!

Thanks

Angela :eek:

View 2 Replies View Related

Combobox Based On Previous Combobox

Jan 25, 2006

I've tried searching the forums and haven't found quite what i'm looking for. I would like to be able to change the source for a combobox based on another combobox. The simplest way i can summarize that is i want to be able to choose A or B, depending on my choice i want another combobox to display all the values that A or B can have.

Thanks

Jim

I'm not sure I worded that very well. :(

View 1 Replies View Related

Combobox Depends On Input Of Other Combobox

Feb 25, 2008

Hey all,

I've read some tutorials on this sort of thing, but I can't seem to piece it all together to achieve what I want.

I have a table Products that contains the fields Product, Size and Brand. I also have a form, frmProducts, that has a combobox linked to each of the fields in the Products table. I want to be able to select a product from the first combobox, tab to the Brand combobox and have only those brands associated with the product already selected.

This is how I think it should work:
1.ComboBox1 selects productA
2.ComboBox2 takes its options from a query that searches Products table for all instances of productA and displays all available brands. brandA is selected.
3.ComboBox3 get its options from another query that searches for all instances of productA that also have brandA and displays all available sizes.

What I'm having trouble with in particular is passing the data between queries. For example, I can't figure out how to tell the query to search for all instances of productA when its defined by the first combobox. Do I have to store it as a variable somewhere?

I hope I've been clear.

View 6 Replies View Related

If FieldName(s) (multiple) = Multiple FieldNames From 2 Tables Then "Error"

Apr 18, 2006

Ok, I have a form where new clients are entered into the system. We would like to have an automated check that could be run which would check several different fields and compare them to several different existing fields in two different tables to see if the same name shows up. What is the easiest way to go about doing something like this?

Thanks.

View 1 Replies View Related

ComboBox ??????

Jun 6, 2005

If I want the combo box to read entry's from one table and then store in another table how would this be done? I think it has to be done with the query builder but I am not sure. I am sorta new to Access.

View 2 Replies View Related

ComboBox Help BAD!!!!!!!PLEASE

Dec 8, 2006

Hello,

I have an invoice form with its detail subform that I have been stuck with for a while. The main problem is on the detail subform, here is what I have:

1. I have 5 fields, DepartmentID, ProductID, Qty, Price, Total.

2. The department is a combobox and I want to select the department that the product is from. Example: If I will be selling a pvc pipe I should select PVC Department.

3. Once I select the department I want the product combobox to only show the products from that department. So I select Electrical Department I can only see what items belong to the Electrical Department.

That is basicaly what I need it to do. So, I worked hard on this looked at samples, read threathds, pull all my hair out, almost done eating all my nails, and most of you know how that goes!!!!

Well finaly after sleepless nights I got something to work!!! I was able to make the product combobox only show the items from that department, Man I was jumping of joy!!! I turnon my radio and put on "Eye of the tiger" and started boxing away!!!! jejeje

Well, I started to make it look pretty, changing the looks and changing the comboboxes to show me the name of the department not the ID, worked good, than I changed the product combobox to show the name not the ID and something went wrong......

The department combobox does a requery of the product combobox everytime I select the department for a new item. So for some reason it makes the product code from the other item disapear....I cant figure it out!!

I have attached the DB, goto frmFactura there is already one invoice started, I have selected the PVC Dept and the Product, you can also see the prtoduct code, once you goto the next item and select another department the prodcode desapears but the prodid stays...


CAN YOU HELP ME PLEASE!!!!!

View 3 Replies View Related

Combobox

Jan 22, 2008

Hallo,

Simple question, is their a way of showing the value on the combo box without saving it in a table. Therefore, when you open the form again next time the value last selected is viewed again.

Thanks

View 1 Replies View Related

Combobox

Mar 8, 2005

On a form i have 25 comboboxes with names the form is based on a table (tblpersons) with the key personID now how can i in all the comboboxes in the event before update
doing the following:

when i select a name in a combobox before update i want to search in all the combobowes of that name i selected not 2x selected is and and if not then the name must in the field otherwise it would tell me that thr name al is selected in another combobox. If the name i selected is ok then this name must not again availible in the combobox

can someone help me with that code please?

Is this with a loop?

View 4 Replies View Related

ComboBox Help

Apr 18, 2005

I want to have a combobox draw its information from more then one column in the same row from the table, but show as only one column when a user clicks on the combobox in the form.

Example of what I am doing...

Table with contact information:
Contact, Phone1, Phone2, Phone3

Combobox on form for contact log: (what I want but not sure how to do)
Phone = (Phone1, Phone2, Phone3 in a single column)

I need the combobox to be able to select each phone number seperatly from that contact so I can show which number was called.

View 4 Replies View Related







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