473,394 Members | 1,752 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,394 software developers and data experts.

Is a reverse lookup possible?

Bit of an odd one, I will admit, but...
I have a value in a table which I want to use to select a text box's value in a form, in other words, it will select the value of the text box named within the value of the form.

Is this possible?

The reason is I want to run a loop based on a number that decreases by 1 each time, and there is obviously a few different values that need to be picked up.
Dec 13 '10 #1
4 2339
Anyone? Or am I going to have to do a select case for every possible value?
Dec 14 '10 #2
Stewart Ross
2,545 Expert Mod 2GB
Hi James. Could you explain a bit further what you mean? It is not clear from what you've posted what the table value is, and how it should relate to the textbox you mention.

Sample data would help us to see if there is a simple way to frame the 'how' steps of what you want to happen.

-Stewart
Dec 14 '10 #3
No problem,
The table has several fields on it which are (tblFolders):
key ID (autonumber for primary key)
ID (Number)
FolderName (Text)
UserdependentYN (Yes/No)
UserInputfield (Text)

The UserInputField realtes to a specific text box on the form, for example a Value of "ClientName" in the userinputfield of tblFolders would relate to the combo box ClientName in the form, and a value of "JobNumber" would relate to the text box JobNumber in the form.

What I want the code to do, is then get the value contained within the specified box (such as the Client Name, or the Job Number) into the vba code, so I can then use it for other things.

The reason I am doing it this way, is the code sets up folders, but up until now, I have had to specify all the folders in the vba code. I have therefore specified them in a table and have used Dcount to specify the number of times it loops the code, and the ID value in the table to sepcify which value its currently on.

I hope that makes some sense!
Dec 14 '10 #4
Stewart Ross
2,545 Expert Mod 2GB
The following simple function returns the value contained within a particular named control on a given named form:

Expand|Select|Wrap|Line Numbers
  1. Public Function FormFieldValue(ByVal FormName As String, ByVal FieldName As String)
  2.     FormFieldValue = Forms(FormName).Controls(FieldName)
  3. End Function
You could use it by supplying the name of the form containing the textboxes you are looking up, and the fieldname as contained in your table. Note that the fieldname is a text string without the square bracket delimiters, as in "Your Field Name" and not "[Your Field Name]".

Example from VBE immediate window on a live form:

Expand|Select|Wrap|Line Numbers
  1. ? formfieldvalue("frmNotes", "Heading")
  2. Finance
You can of course supply appropriate variable names or recordset fields as arguments in place of the fixed values shown above, like this:

Expand|Select|Wrap|Line Numbers
  1. YourValue = formfieldvalue(yourformname, RS!tablefield)
-Stewart
Dec 14 '10 #5

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

Similar topics

4
by: Pjotr Wedersteers | last post by:
Hi PHP buddies, I want to include a reverse DNS lookup (find host/domain for a given IP) in my pagetracker scripts. Is there anything prefab in the PHP world I am overlooking I could put to use...
5
by: tjland | last post by:
Okay so im working on a very simple encryption method using just loops. Kind of novel i think. Okay so first i set up a list of the alphabet with just every seperate letter, then user is prompted...
1
by: Anthony Liu | last post by:
In terms of file input, can we read from the end of the file till the beginning of a file? __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam...
12
by: rudysanford | last post by:
I just started messing with programming and started with Python. Part of my first project deals with translating numerical values to letters. I would like to be able to do the reverse as well,...
8
by: rh0dium | last post by:
Hi all, I have a dict which looks like this.. dict={'130nm': {'umc': }, '180nm': {'chartered': , 'tsmc': }, '250nm': {'umc': , 'tsmc': } }
8
by: schaf | last post by:
Hi NG! I have a problem in my remote application. After calling a remote function the calculation will be done by the service. The calculation result will be sent to the caller (client) via...
1
by: Scott McFadden | last post by:
Using .NET, what are some good ways to determine which country a given IP the request IP address resides in? thanks scottm
1
by: onequestion | last post by:
Hi friends.. Reverse lookup is not working for some ip. nslookup www.aircell.com gives 74.50.0.200 but nslookup 74.50.0.200 gives sirona.lunarservers.com...
0
by: WillBeaden | last post by:
I would like to return the column names from a linked spreadsheet in Access, where the value is 1 (or greater than zero will do). Example: STYLE | VAL1 | VAL2 | VAL3 | VAL4...
1
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
I just need simple information specificly the carrier of the phone and if it's a moble unit. Is there a web service some one here can recomend? -- Share The Knowledge. I need all the help I can...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.