ACCESS VBA - why different from other vba? 
Author Message
 ACCESS VBA - why different from other vba?

This is the first time i use VBA in Access, but I found sometime odd as
compared to other vba:
1) I want to show and hide form using event procedure (of a button on the
form), rather than macro. But:
myform1.hide
myform2.show
doestn work because there is no such actions in Access vba! I must do this
as an event procedure. How?

2) I have a clear button on the form so that once it is clicked, the entry
in text box is clear. So my code is:
private sub clearbutton_onclick ()
textbox1.text = ""
end sub

To my athonisment, this simple code doesnt work too. Why?



Sat, 04 Sep 2004 22:54:24 GMT  
 ACCESS VBA - why different from other vba?
This has nothing to do with VBA. Access has a forms package that has been
around since before the MS Forms 2.0 ("Forms Cubed") was even devloped. The
object models have some similarities; as you noted there are also many
differences.

Asking why "this simple code doesn't work" is like wondering why one cannot
fit one's apartment key into their car to start it. After all its so
"simple". :-)

--
MichKa

Michael Kaplan
Trigeminal Software, Inc.  -- http://www.trigeminal.com/

International VB? -- http://www.i18nWithVB.com/
C++? MSLU -- http://msdn.microsoft.com/msdnmag/issues/01/10/


Quote:
> This is the first time i use vba in Access, but I found sometime odd as
> compared to other vba:
> 1) I want to show and hide form using event procedure (of a button on the
> form), rather than macro. But:
> myform1.hide
> myform2.show
> doestn work because there is no such actions in Access vba! I must do this
> as an event procedure. How?

> 2) I have a clear button on the form so that once it is clicked, the entry
> in text box is clear. So my code is:
> private sub clearbutton_onclick ()
> textbox1.text = ""
> end sub

> To my athonisment, this simple code doesnt work too. Why?



Sat, 04 Sep 2004 23:04:08 GMT  
 ACCESS VBA - why different from other vba?
WWChew schrieb:

Quote:

> This is the first time i use vba in Access, but I found sometime odd as
> compared to other vba:
> 1) I want to show and hide form using event procedure (of a button on the
> form), rather than macro. ...
> 2) I have a clear button on the form so that once it is clicked, the entry
> in text box is clear. ...
> To my athonisment, this simple code doesnt work too. Why?

There's a very simple answer: Because it's a Microsoft Product
(= forget the ideas you might had about logic and converging
structures / interfaces).

Ralf.



Sat, 04 Sep 2004 23:46:31 GMT  
 ACCESS VBA - why different from other vba?
The problem is that you're used to a slightly different
object structure than what Access has.  Here's what you
need to do:

1) To show and hide a form, you have to set the Visible
attribute, like -

form.Visible = False     'hide the form
form.Visible = True      'show the form

2) To clear a textbox, the attribute you need to set Value
= txtClearMe.Value = ""   'clear the txtClearMe textbox

Hope that was what you were asking.

Paul

Quote:
>-----Original Message-----
>This is the first time i use vba in Access, but I found
sometime odd as
>compared to other vba:
>1) I want to show and hide form using event procedure (of
a button on the
>form), rather than macro. But:
>myform1.hide
>myform2.show
>doestn work because there is no such actions in Access
vba! I must do this
>as an event procedure. How?

>2) I have a clear button on the form so that once it is
clicked, the entry
>in text box is clear. So my code is:
>private sub clearbutton_onclick ()
>textbox1.text = ""
>end sub

>To my athonisment, this simple code doesnt work too. Why?

>.



Sun, 05 Sep 2004 02:01:48 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Access 97 VBA v Access 2K VBA - different ?

2. Linking Access Tables in Different *.mdb Files, Populating an Access Table From Several Others

3. Linking Access Tables in Different *.mdb Files, Populating an Access Table From Several Others

4. Access 2000 VBA Handbook vis a vis Access 97 VBA Handbook

5. Launching a different database from a different db w/ vba

6. Why can't I open an Access DB in VBA

7. Access VBA Calling MSWord/Excel VBA?

8. VBA Analysis Tookpack- Excel In Access VBA

9. vba access vs vba excel (alguien sabe?)

10. Is Access VBA as fast as VB VBA?

11. How to access Office VBA from Outlook VBA

12. Exec. Word VBA Function From Access using VBA

 

 
Powered by phpBB® Forum Software