Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access&VBA focusing problem

Status
Not open for further replies.

asbach

Technical User
Jun 15, 2005
10
FI
Hello!

I am truly just beginning to even think to make any forms&reports and I am totally stuck/lost in very simple issue. I am using MS Access 2007 and its VBA tools -no special VB-application at hand.

There I have few tables, without any relationships. I have table A, where I have fields "x" and "y".
A.x A.y.
XXXX xyz.ltd
TTTT abc Ltd.
EFGH RTY Ltd.
WERT Rew Ltd.

In the e m p t y form I add one inputbox and one label. No

This inputbox is a box, where I type a string (e.g. "WERT"). This would correlate to field A.x. Then, label would show an updated value of A.y. (e.g. in this case "Rew Ltd.")

I try to make a form, where I list in the labels string values and after the form is ready, 1) print a report, 2) store the data into file/this database, 3) empty all fields (to start again with a blanco form. Any ideas of doing it smartly from the beginning?

Any help is highly appreciated.

Kind regards and thanks!

-Asbach
 
Are "all fields" for one record, and then you are then filling all the fields for a new record?

If so, then the basic form type (which should be what you have) is the form type that you need...

For each of your fields, you need a text box, list box, combo box, or possibly one of another control. It depends upon what data goes in each field, and how you want to select it. For instance, if one of the fields is always going to be one of a certain number of values, then you can have a separate table with those common values (or a value list within your combo box control), so that you limit the possibility of input errors.

But it sounds like you're asking a very broad, generic question. You need to just "do it" mainly, and then ask your specific questions to get the best answers.

I'd say that if you are unsure as to what to do, or how to do to begin with, the easiest way to get started is to just start over with your form.

Create a new form, using the form wizard (not design view), and then edit the form in design view to make sure it's doing exactly what you want.

Then when you run into specific questions, post your specific questions here.

--

"If to err is human, then I must be some kind of human!" -Me
 
How are ya asbach . . .

The big questions is: [blue]are the labels attachded or unattached?

If attached, the labels move with the textbox when you reposition the textbox.

If the labels are attached, then changing the caption is a simple matter of:
Code:
[blue]   Me![purple][B][I]YourTextboxName[/I][/B][/purple].Controls(0).Caption = "[purple][B][I]YourTextHere![/I][/B][/purple]"[/blue]
[blue]Your Thoughts[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
That's interesting, AceMan, I never thought of accessing attached labels that way before. I've always dealt with them directly, whether attached or not. Hmm, I'll have to remember that for next time just to see.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top