473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dlookup result into Table field

I get the results to go the textbox on the screen but not to the field to textbox represents (table field).

thanks
This is in ms access
Sep 19 '14 #1
11 2948
twinnyfo
3,653 Expert Mod 2GB
Ray,

Have you tried to refersh the Form after the Text Box is updated?
Sep 19 '14 #2
Yes, the screen is doing fine it is just display not filling the field
Sep 19 '14 #3
twinnyfo
3,653 Expert Mod 2GB
Does the control have as its record source the underlying field in the table? If it is, a refresh should update the field.
Sep 19 '14 #4
BoxInfo = Table
BoxStreet = field name
StreetDelvInfo = ComboBox selected

Text box with BoxStreet from BoxInfo

BoxStreet - Control Source -
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("Street","Address","Id=" & [StreetDelvInfo])
display in the form but is not in the field - BoxStreet even after leaving the form.
Sep 19 '14 #5
twinnyfo
3,653 Expert Mod 2GB
Ray,

Your combo box does not have as its control source the Table. You are just telling the Combo Box to look up values from the table.

The Combo box must have as its control source the Field BoxStreet. Its row source should be a Select Query and Not a DLookUp value. You will always only return one value in your Combo Box, otherwise.
Sep 19 '14 #6
The combobox has 4 item id, address, street, zip
Id is place into BoxInfo BoxHoldId correctly as you said above
What I'm trying to do is pick one time from the Address table
- address, street, zip - and place those values into the table BoxInfo as BoxInfo will after 30 day be archived - all id's for BoxInfo may be changed.
Sep 19 '14 #7
twinnyfo
3,653 Expert Mod 2GB
Ray,

I am having trouble understanding what you are saying--please forgive me. However, one key issue is that in Post #5 above, you say BoxStreet has a control source of =DLookUp("Street","Address","Id=" & [StreetDelvInfo]), which will not allow you to choose from values. A combo box must have a query (or Select Statement) for a list of values.

Also, based on the discussion, it is impossible for a Combo Box to have a DLookup Statement as its Control Source AND also be associated with a field in an underlying table.

Something is amiss with your Form/Table/Combo Box set up.
Sep 19 '14 #8
Sorry wasn't detailed enough.
I have header/footer on
in the header section I have a combobox from table address:
Id, Address, Street, Zip
control source is BoxHoldId in the Detail section of the form.

detail part of the form I a table BoxInfo:
all of the BoxInfo tables are TextBoxes. among those boxes are
BoxHoldId control source BoxHoldId
BoxAddress control source:
Expand|Select|Wrap|Line Numbers
  1.      =DLookUp("Address","Address","Id=" & [StreetDelvInfo])
BoxStreet control source:
Expand|Select|Wrap|Line Numbers
  1.  =DLookUp("Street","Address","Id=" & [StreetDelvInfo])
BoxZip control source:
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("Address","Address","Id=" & [StreetDelvInfo])
  2.  
and more

I also have the three field in private variable in event Click
from the combobox.
any help on getting these from either side would be great.
thanks
Sep 19 '14 #9
zmbd
5,501 Expert Mod 4TB
RayTrussell
This is becoming a lost thread.

Rowsource = This is the information that a combobox or list box will display to a user to choose from

Control Source = This is what makes a control either "Bound", "Unbound, or "Calculated." That is to say, this property points to the field of the table or query where the data is to be stored or is used to display the result of a form/report calculated result.

The two properties ARE NOT EQUAL nor interchangeable.

What information you have provide so far indicates that all of the controls thus-far presented are calculated controls and as such are not automatically stored in the tables. Nor should any calculation be normally stored to any table unless needed for auditing or historical reasons such as a variable discount/tax rate/etc...

So, RT, please take a deep breath, review the FAQ - How To Ask A Question , rethink your question clearly, and make that your next post.

I will happily take that post and push it into your original post and we can start over (^_^) otherwise I'm afraid that this thread is drowning.
Sep 20 '14 #10
Thanks for the help!!!

This was to easy Here is the solution I finally came up with.
Expand|Select|Wrap|Line Numbers
  1. Sub StreetDelvInfo_Click()
  2.  
  3. Forms!BoxInfoF!BoxAddress = DLookup("Address", "Address", "Id=" & [StreetDelvInfo])
  4. Forms!BoxInfoF!BoxStreet = DLookup("Street", "Address", "Id=" & [StreetDelvInfo])
  5. Forms!BoxInfoF!BoxZip = DLookup("Zip", "Address", "Id=" & [StreetDelvInfo])
  6.  
  7. End Sub
Thanks again it made me dig harder!!!
Sep 21 '14 #11
zmbd
5,501 Expert Mod 4TB
I'm glad you found a solution.

However, from the solution given, it indicates that your database may suffer from a lack of > Database Normalization and proper Table Structures.

In a NEW thread if you list you tables, table relationships, and the goal of your project someone here might be able to help clean up the schema.
Sep 21 '14 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Onion | last post by:
This has to be simple, but I'm forced to admit that I'm a novice who can't figure it out. I have a listbox in a form that allows multiple selections. That works fine. The problem: I can't...
10
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
2
by: Bob | last post by:
How do I extract the value of a table field and save it to a variable of similar data type in VBA ? Thank you in advance, Bob.
2
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What...
3
by: MLH | last post by:
Generally, I do not monkey with renaming controls on forms whose name, by default, matches the name of their related table fields. But I noticed the following today If IsNull(Me!VColor) Then...
2
by: NowItsWhatever | last post by:
In query DESIGN view, how do I automatically "fit" the columns in the table/field grid to the lengths of the table and field names (including any functions applied to the fields). I am not talking...
2
by: mukesh | last post by:
Can we use expression in default value for a table field for example – IIf(Table-1.field-1=table-2 . field-1, table-1.field-2, 0) Interpretation – If field-1 of table -1 is like/equal to...
3
by: adiel_g | last post by:
Hello everyone, I am trying to move a field name to a variable in vb.net. For example, first I retrieve the record from the database and save its value: .... userGroup =...
1
by: marinas908 | last post by:
I am declaring a cursor with union on two similar tables, during fetch i use 1st table dclgen and fetch into those columns. My result table is a correct union of two tables. The problem is the first...
3
by: jeanydoggy | last post by:
I need to use a variable value as a table field name. But when I ran the code, it gave me error and didn't use variable value but used the variable as the field name. I defined the following Sub and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.