Auto File upon condition

  • Thread starter Thread starter tryn2learn
  • Start date Start date
T

tryn2learn

I'm trying to set up a form that once a certain job name is entered the
client and group attached will automatically fille in. is this possible>

Job name Client Group
a011195 ABC Letters

Once the job is entered I would like the (ABC) and (Letters to automaticlly
be filled in)

my coding knowlege is limited...

Thank you,
 
You don't mention this, so I'll assume you already have "ABC" and "Letters"
associated with "a011195" in some table in your database.

A couple thoughts...

First, if you use a textbox, you will force your users to know/remember a
perhaps-meaningless "job name" (i.e., "a011195"). This is user-unfriendly.

Instead, if you used a combobox that listed jobs (and suitable identifying
information, like, say, Client and Group), you could allow your users to
SELECT the job, rather than remember/enter.

Next, you don't mention it, so it isn't clear if you are adding [Client] and
[Group] on that form in order to get them added to the table 'behind' that
form. If so, stop it! If you already know which [Client] and [Group] is
associated with a [job number], there's no need to duplicate it in another
table.

So, if you aren't trying to "duplicate" those two, merely display their
values (in unbound textboxes ... you don't mention this, either), you can
easily accomplish this by having the AfterUpdate event of the combobox
'push' the values into those unbound textboxes. In the combobox's
AfterUpdate event, your code would look something like:

Me!txtClient = Me!cboJobNumber.Column(1)
Me!txtGroup = Me!cboJobNumber.Column(2)

where you substitute your names for the respective controls, and use the
zero-based count of columns in your combobox's source to "feed" into the
textboxes (e.g., if the query that feeds your combobox has three fields,
[JobNumber], [Client], [Group], then "0" refers to the first column -
[JobNumber] - and "1" refers to the second column - [Client] - and so on...)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top