VB and Access

P

peter

Hi,

I am just starting out in learning VB code and Access 2000 use of VB code.
I have a VB code as follows:

VB code

Private Sub Form_Load

Form1.show
For i=1 to10
print i
next i

End Sub

I was wondering is it possible for Access to use a similar type of code when
I create a form in Access?

Thanks.

Peter
 
J

John Vinson

Hi,

I am just starting out in learning VB code and Access 2000 use of VB code.
I have a VB code as follows:

VB code

Private Sub Form_Load

Form1.show
For i=1 to10
print i
next i

End Sub

I was wondering is it possible for Access to use a similar type of code when
I create a form in Access?

Where do you want i printed? (The answer is yes, sort of, but not that
way exactly). A Visual Basic FORM object and an Access FORM are very
different objects, with different properties; there is no "show"
method for an Access form, for instance.
 
P

peter

Thanks for your reply.

Well let's say that I want to show the data in a text box of a form.

Is that possible.?

How would the coding be like?

Would it be like

textboxname.somethingsomething?

Thanks.

Peter
 
J

John Vinson

Thanks for your reply.

Well let's say that I want to show the data in a text box of a form.

Stop.

If you are approaching programming in Access as a slight change to
programming in Visual Basic, you'll end up VERY frustrated, and find
yourself doing things the hard way when they can be done much more
easily.

Access IS NOT VISUAL BASIC. It lets you use VBA as a tool to add
"bells and whistles" to native Access features, but you *start* with
the Form, and add VBA code only if necessary. You're starting at the
wrong end. You'll find it MUCH easier if you learn a bit about how
Access works in its own way, rather than trying to force it to act as
a flawed implementation of VB.
Is that possible.?
Certainly.

How would the coding be like?

No code at all. Simply set the Form's Recordsource property to the
Query, and the text box's Control Source to the name of the table
field.
 

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

Top