Auto-populate fields based on changing one.

This has probably been ascked and answered before but my searches have
turned up blank so here goes...

I have an existing database system that requires 3 fields updated in
one table (hardware) from another(clients) when creating a new record
(ClientName,ClientID,ClientLoc) I have a Combobox so the user can
select the ClientName but I am having trouble figuring out how to
update the other 2 fields to match.

I have tried adding the other 2 colums to the ClientName filed and
using a SetValue macro to assign ClientName(2) and ClientName(3) to
ClientID and ClientLoc.  I can see the other columns in the ClientName
list but I seem to be unable to assign them to the other field.

Thanks in advance for any help,
Will

0
Will
7/31/2007 6:40:34 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
1770 Views

Similar Articles

[PageSpeed] 57

Will,
    Actually, you should be capturing the ClientID in your combobox... not 
the name.  Names are not unique enough to always be sure of no dupes.
    Also, there's no need to capture the ClientName or ClientLoc. Once 
you've cpatured the ClientID, those associated values can be derived (and 
"displayed")on your form.

    Here's a better method...
    Create a 3 column combo with ClientID, Client Name, and ClientLoc.  (ex. 
cboClientID)
    Bind that combo to the ClientID field.
    Setup the combo with...
        NoOfCols = 3
        ColWidths = 0"; 2"; 2"
        Width = 4"
    What this combo setup will do is... display the ClientName and ClientLoc 
so that the user can easily select the correct Client.  After a selection is 
made, the combo will still show the ClientName...BUT... it is actually 
storing the ClientID in the ClientID field of your table.
    Now, just add an unbound calculated text control to your form (ex. 
ClientLoc) with a ControlSource of...
        = cboClientID.Column(2)
    (combo colums are numbered 0, 1, 2, 3...)

    So... we use the cboClientID ControlSource to capture the ClientID, and 
also use the combo to "display" the ClientName, and an unbound calculated 
text control to "display" the Client Location on the form.

    Remember... if you have the ClientID, you can always re-derive any 
associated client data in any subsequent Form, Query, or Report... via that 
ClientID.

-- 
hth
    Al Campagna
    Access MVP 2007
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love, and you'll never work a day in your life."


"Will" <wperry1@gmail.com> wrote in message 
news:1185907234.157948.269460@e9g2000prf.googlegroups.com...
> This has probably been ascked and answered before but my searches have
> turned up blank so here goes...
>
> I have an existing database system that requires 3 fields updated in
> one table (hardware) from another(clients) when creating a new record
> (ClientName,ClientID,ClientLoc) I have a Combobox so the user can
> select the ClientName but I am having trouble figuring out how to
> update the other 2 fields to match.
>
> I have tried adding the other 2 colums to the ClientName filed and
> using a SetValue macro to assign ClientName(2) and ClientName(3) to
> ClientID and ClientLoc.  I can see the other columns in the ClientName
> list but I seem to be unable to assign them to the other field.
>
> Thanks in advance for any help,
> Will
> 


0
Al
7/31/2007 11:03:35 PM
Reply:

Similar Artilces:

My keying is changed ...
Hi, When I enter text into Outlook 2000 it shows different results. For example, if I enter dog it may show ket. Every character is changed. If I close Outlook and reopen Outlook everything is working fine for a while then it starts up again. Today, a person who sends me email and I send email to has the same problem. Did a virus cause this? If so, how do I get rid of the problem. Also, how did this happen if I have antivirus protection and a firewall? Thank you for your help. On 12 Apr 2005 15:57:02 -0700, lanalewis@yahoo.com wrote: >Hi, >When I enter text into Outlook 2000 i...

Sum based on multiple conditions
I have Column A with a "stage" in it that will range from 1 - 8 I have column B with a "close date" in it that could be any date I have column C with a value in it. I need the sum of the values in C that have Close dates in any given range (ex. 10/1/2004 through 10/31/2004), that are in any given sales stage. I tried using SUMIF which seems to only work with 1 condition...so I can do =SUMIF(AA,1,CC) and it will give me the sum of the values that are in stage 1. SUMIF doesn't appear to work with ranges or multiple conditions though. =SUMPRODUCT((C1:C100>="...

Auto Filter problem
I am using the auto filter for a particular column to sort out differen medical programs. When I click the drop down and click a program, i doesnt show me ALL the lines that say this particular program. Why is this? -- Message posted from http://www.ExcelForum.com Hi maybe some hidden characters in these lines 8e.g. additional space characters, etc.) -- Regards Frank Kabel Frankfurt, Germany "jkb724 >" <<jkb724.19rasx@excelforum-nospam.com> schrieb im Newsbeitrag news:jkb724.19rasx@excelforum-nospam.com... > I am using the auto filter for a particular column to so...

Populate a cell if values in cell 1 and cell 2 match cell 3 and 4
I need help with a formula please. I need to search through a column of data and populate a cell if it meets a condition. For example: IF FirstWorksheet!A2 = SecondWorksheet!ColumnAx and FirstWorksheet!B2 = SecondWorksheet!ColumnBx Then populate SecondWorksheet!Cx with value from FirstWorksheet!C2 I have to match up a column of data in one worksheet with data in 2 columns in another worksheet. Help plz. Thanks T- A multi-criteria index n match (array-entered) should work here In Sheet2, Copy n paste this into C2's formula bar, then array-enter the formula by pressing CTRL+...

Creating linked fields
How can I create a linked field eg I have Account no in General tab and I create another tab which requires the same Account no to be present basically its the same field in the database so in the tabs it projects the same data ! when typed in the General tab ! It is not possible to have the same field displayed on more than one tab with the current version of the product. I am not sure if it is going to be possible to do this in V2. Anyone know? Guy. "Rick" <Rick@discussions.microsoft.com> wrote in message news:D7EE8552-C4F2-4143-A4C6-B9268C4CF4C9@microsoft.com... &g...

Calc Field to list invoices paid by same check on one line of repo
Hi I have a customer who wanted a check dump file to send to their bank. Once the bank receives the file (in txt or tab delimited), they will use the infomration to actually print the checks for the customer. (This is not a positive pay file situation.) I was able to take one of the check forms and modify it to get all the data required by the bank. I am running into a snafu with getting it down to one line per check with multiple invoices listed one one line. It is listing the total check and one line per each invoice paid by the check: Example: Ck 2345 for $800.00 -...

Auto-Editing
Word 2003 has a very annoying default. It assumes too much! If I reformat a few words in a document, it changes the entire document to that formatting. Grr-rrr-r! I have to constantly press undo to get what I want. I know there's a feature that's causing this annoyance but I can't find it to turn it off! Can anyone help, please? See http://word.mvps.org/faqs/formatting/wholedocumentreformatted.htm. -- Stefan Blom Microsoft Word MVP "Connie Martin" <ConnieMartin@discussions.microsoft.com> wrote in message news:CD959D82-F81B-4A9D-993E-73...

Pivot Tables & changing data
Hi - I have never used pivot tables in Excel before so hopefully what I am going to ask is possible and not too complicated for me.... :o) I am working with Excel 2003. I have a pivot table already set up and the information is pulling data from a row titled "sum of Subscriber". I added new data in a new column from the main spreadsheet and I would like to pull the data from there. Its titled "Adj Subscriber". Is it possible to switch it? If so, how? Thanks, Anna Marie Anna wrote: > Hi - I have never used pivot tables in Excel before so hopefully what I am &...

"From Field" Problem in outlook 2003
When connecting to another users profile that has "Send As" enabled on its and changing back to my profile i now receive the "From" field when replying to a message (that was not there before) on my profile with my name in it. if i try to send a message with my name in the from field i do not have permissions. i think this is a caching problem has anyone seen this problem? ...

Get contents of field in a subform
I have a form named frmTicOpenAsgnTab based off my TICKET table. On this form I have a JOURNAL tab which holds the subform sfJournal (based off my JOURNAL table) and is a Continuous Form. On the subform sfJournal I have the field EntryText which is a field in the JOURNAL table. The tables TICKET and JOURNAL are linked by the TicketID in a one to many relationship. I have a command button named cmdEmailUser located on the main form where I need stText to equal the contents of the EntryText field. My code is as follows but line for stText is what doesn't work. stText = Forms!fr...

How do I change the "Project Type" in "law Firm Financial Analys..
he "Lawfirm Financial Analysis Worksheet" currently has only attorney related "Projects Types," e.g., bankruptcy, forming corporations, amublence chasing. I'd like to modify the worksheet so it would fit other professions, i.e., engineering, consulting, and the like. Are these worksheets, including the law firm financial analysis worksheet, modifyable? If you download the worksheet: http://office.microsoft.com/en-ca/templates/TC011406201033.aspx you should be able to modify it. Clear the existing project types, and replace them with the ones you need. seanac...

Auto-Calculate
I have a spreadsheet that utilize the stock quote add-in from MSN. On a daily basis I refresh the add-in functions for the Highs, Lows, Last, Volume, etc. On occasion the spreadsheet reverts to manual caculation settings, and I have to press the F9 even after I updated the quotes. I've always preferred the any spreadsheets I open, blank or otherwise, the automatic setting selected for calculations. I consider this an annoyance. Has anyone experienced this glitch? Is there a fix for it? Ron_D Ron Excel takes the calculation mode from the first workbook that opens in a session. Sub...

auto copy self
How do I arrange for Outlook to automatically copy myself on every new, reply or forward email? If you mean keep a copy of all sent, see settings under Tools/Options/Email Options and Advanced Options David "rich" <steamuk@aol.com> wrote in message news:055c01c3664f$dadecd30$a001280a@phx.gbl... > How do I arrange for Outlook to automatically copy myself > on every new, reply or forward email? ...

Access 1.1 Data Base Migration to Access 2002
I have an older IBM Activa running Access 1.1 under Win 95, with a single 10 columns x 950 records table. I also have a new Dell running XP and XP Professional. There is no physical connection between the two PCs. I am told by Microsoft Support that only Access 97 (release 8.0), and later, are suported by Access 2002. I really do not want to retype all that data for this wine cellar inventory! If I could get a copy of the Access 97 upgrade CD, I could upgrade the old 1.1 to 8.0, and then migrate the file to Access 2002 on the Dell. I would then kill the old Access, return the C...

Column reference got changed
Column references in my excel sheets which which usually show as A B C D ....... are now showing 1 2 3 4 5 Please help willy wrote: >Column references in my excel sheets which which usually show as A B C D >...... are now showing 1 2 3 4 5 >Please help Tools | Options, General tab. Untick R1C1 reference style. -- Message posted via http://www.officekb.com Goto <Tools><Options><Settings> and untick <R1C1 reference style>. Regards. Bill Ridgeway Computer Solutions "willy" <willy@discussions.microsoft.com> wrote in message news:DB0C70...

Auto Scale Chart Macro -- Any improvements please?
This is the best way I've found to correctly scale a chart -- the only way I found to exclude a chart interpolating with #NA cells was to delete those cells containing #NA, and run the chart. This takes a long time on my computer. Wondering if there is a better way. This macro is directly taken from 2 excel mvps and modified; i believe a mehta and ron bovarty, but could be wrong. Thanks for taking a look. Sub AutoScaleYAxes() Dim ValuesArray(), SeriesValues As Variant Dim Ctr As Integer, TotCtr As Integer Application.Run "Extend_Stock_Data" Applic...

Auto correct or Auto complete
We are all familiar witht he auto correct or auto complete functions found in MS applications. Of course that means it is available in Access also. My question is this ... can this function be replicated within the DB, so that the set of auto correct items are part of the package rather than something that would have to be set up on each individual desktop system? It's use, for me, would primarily be within a memo field where medical abreviations, used as a shortcut, would convert to the true meaning as the user types them in. Ex: "prn" without quotes would change to. &qu...

transferring address book from outlook express on one computer to.
i want to copy my address book from my main computer to my laptop. i was using outlook express and now am using outlook 2003. So how did you back up this address book and in what format is it now? Have you already transferred this data to Outlook Express? That would be the first step you would need to take. Once you do, you can import into Outlook. -- Russ Valentine [MVP-Outlook] "milpj4" <milpj4@discussions.microsoft.com> wrote in message news:F1DFDA41-1120-4701-9DBB-60754473C9E5@microsoft.com... >i want to copy my address book from my main computer to my laptop. i ...

Print several reports based on criteria in a form
I am cross posting this in both the Forms and the Reports forums. Let me apologize in advance because this is going to be somewhat scattered and somewhat hypothetical at the moment because I don't have a clue where to begin. I will do my best to make it coherent. I have a form (frmBids) with two sub forms (sbfBids & sbfBidSubs). The main form has several fields regarding the Bid Proposal --- Bid Contact, Bid Company, Due Date, Bid Contract (Prime or Sub), among others. The sbfBids subform is visible all the time. This sub form includes information on the work that is being reques...

OWA auto login
I am trying to use the credentials from the forms authentication login to automaticaly log in to Outlook Web. I redirect to a URL with this format: http://UserName:Password@mailserver/exchange I have seen this example in other posts but this does not work for me. I still get the Outlook Windows Login prompt. Perry Perecli Manole wrote: > I am trying to use the credentials from the forms authentication > login to automaticaly log in to Outlook Web. I redirect to a URL with > this format: http://UserName:Password@mailserver/exchange > I have seen this example in other posts but t...

unsaved changes
Hey all, I was just curious does anyone know if you can recover an unsaved data, i made changes to an excel worksheet and I accidently exited out without saving the changes, can i recover all that data, it took me an hour to do? If you exited XL normally, you're out of luck. In article <BC3B2D1C-31C6-479A-A53D-1DF8190F67A2@microsoft.com>, accidentalprone <accidentalprone@discussions.microsoft.com> wrote: > Hey all, > > I was just curious does anyone know if you can recover an unsaved data, i > made changes to an excel worksheet and I accidently exited out...

Auto look through subfolders
Please help. I can write a macro that will extract data from all excel files in a specific folder. What I need to be able to do is write a macro that will automatically extract data from excel files within folders and sub folders and sub sub folders etc For example the data is all held on the following directory: H:\development forms\2006 cost sheets\ And within that directory by customer - for example Tesco, Boots, Asda etc. These customers are then subdivided into product ranges - eg 1,2,3,4 etc and some futher subdivided by national or exclusive. All the excel files are in exactly th...

Any way to get rid of an auto-suggestion in the login dialog box, for Exchange/OL using RPC over HTTP?
A client was using RPC over HTTP to two different Exchange servers (OL prompting for profile on startup). Both profiles were set up to prompt for credentials upon connection to Exchange. There's now only one Outlook profile needed; the other is gone and OL isn't prompting for the profile selection any longer, which is fine. However, Outlook is remembering domain1\user and domain2\user in the login dialog box, and I'd love to be able to get rid of the no-longer-valid credential dropdown suggestion. (The computer is not a member of a domain and hence always needs to be prom...

Turning off formatting when tracking changes
When we are tracking changes, then save the document, and open it later, the formatting shows up on the right side of the page. When I click on the Review tab and unclick the arrow beside Formatting under show Mark-up, it goes away. Then I save, and every time I open it, it's back again. I only want to track the changes in the document, not the formatting itself, but it seems as if this is a default and I can NOT get it to go away....I don't want to accept the changes until appropriate folks have reviewed it, but when I send them the document, they all complain about t...

Auto date
I am trying to create a field in a form that if anything is changed on it, it will automatically update the date to current date. Is this possible? Sojaminc wrote: >I am trying to create a field in a form that if anything is changed on it, it >will automatically update the date to current date. Is this possible? Make sure the last changed date/time field is in the form's record source table/query. Then use the form's BeforeUpdate event: Me.lastchanged = Now -- Marsh MVP [MS Access] Hi - You can do this in the On Dirty event of the form, which fires as soon as you m...