dbTalk Databases Forums  

A2010. Question on macro

comp.databases.ms-access comp.databases.ms-access


Discuss A2010. Question on macro in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Salad
 
Posts: n/a

Default A2010. Question on macro - 02-10-2011 , 01:34 PM






I opened the Contact Web database template. Form Main has a hyperlink,
actually a command button that looks like a huperlinl, that has the
caption "Configuring The Database".

The macro for the OnClick event sets a tempvar callec tmpVideo and sets
the value to a hyperlink. It then "BrowsesTo" a form called VideoPlayer
and has the path as
Main.NavigationSubform>GettingStarted.sfrVideo

If I open form Main in LayoutView (there's no design view), open the
property sheet, I can select NavigationSubform from the dropdown list of
controls. There is no form "NavigationSubform".

There is a form however called "Getting Started" that matches the tab
GettingStarted in form Main. May I assume NavigationSubform is an
object tab that was created from a Navigation form and then renamed?

In form GettingStarted there is a subform with the name sfrVideo and the
control source Default Image. The form DefaultImage doesn't seem to be
anything more than a Play button. The image itself has the macro call'
Main.NavigationSubform>GettingStarted.sfrVideo

There are buttons that keep popping up on the forms while in layout mode
that have tiny crosses in square boxes. I suppose that button indicates
a subforms but that's just guessing. I wonder if there's a help topic
that covers icons...you know, the icon on the left, description on the
right? I can't find one.

Anyway, DefaultImage plays the value of the form VideoPlayer. But I
don't see the form VideoPlayer on the GettingStarted form. How does
VideoPlayer overlay DefaultImage.

I'm not sure why there are so many subforms. In the past these might
have simply been controls on a form. Perhaps all the splitting up is to
demonstratene features or perhaps make it work with the web?

Reply With Quote
  #2  
Old   
Albert D. Kallal
 
Posts: n/a

Default Re: A2010. Question on macro - 02-12-2011 , 04:36 AM






??"Salad" wrote in message
news:MKmdnZb6juA2oMnQnZ2dnUVZ_q2dnZ2d (AT) earthlink (DOT) com...

Quote:
The macro for the OnClick event sets a tempvar callec tmpVideo and sets the
value to a hyperlink. It then "BrowsesTo" a form called VideoPlayer and
has the path as
Main.NavigationSubform>GettingStarted.sfrVideo
The above path looks correct. We have the top form called Main. Then we have
navcontorl called NavigationSubform. The browse to command "object" is
simply the name of the form in the navigation buttons we wan to work on.
(that nav button will become active if it is not).

Quote:
There is a form however called "Getting Started" that matches the tab
GettingStarted in form Main. May I assume NavigationSubform is an object
tab that was created from a Navigation form and then renamed?
NavigationSubform is the standard name of the sub form that used in all
navigation forms. In fact as a general rule, NavigationSubform is the
default name.
(so you could rename it, but it was not). Fire up a client application and
create
a nav form, and then bring I up in design view (as opposed to layout view),
you
will see the same defaulted sub form.

As always, remember a sub form is not really a form, but in fact just a
control
on a form (of which we can set the source object).

Ignoring that web forms use the new layout mode (introduced in 2007), those
sub forms do not work really any different then how Access and sub forms
in the past worked. In fact, the only real change here is a sub form control
can
now display a report (and this works for client VBA applications also). So
a navigation form is really just a set of buttons and then ONE sub form
called NavigationSubForm. You could change the name, but for coding
consistancity, I would not.


Quote:
In form GettingStarted there is a subform with the name sfrVideo and the
control source Default Image. The form DefaultImage doesn't seem to be
anything more than a Play button.
Sure, since we can set the "sourceobject" of what will display in a subform,
this is a nice easy way to have a image change occur. We just switch
the sub form from one that displays a image with a click event to one
that has a web control to the internet to display that view.

Quote:
The image itself has the macro call'
Main.NavigationSubform>GettingStarted.sfrVideo
The above is correct. The way the browseto command works is you specify
which object on the nav pane you want to switch. I don't have time to
give a great explain here, and I simply have to get some sleep.
Once you played with the browseto command a few times, then it all makes
sense.

In this case it somewhat more complex since we are setting the source object
of a subform
inside of a subform.

Quote:
There are buttons that keep popping up on the forms while in layout mode
that have tiny crosses in square boxes. I suppose that button indicates
a subforms but that's just guessing. I wonder if there's a help topic
that covers icons...you know, the icon on the left, description on the
right? I can't find one.
No, the little + or cross hair means you are using a layout control. As
noted, these were introduced in a2007, and they help huge in reports and
forms for layouts.
I will say that in a web form, since you have to use layout view, then they
are not as helpful.

Quote:
Anyway, DefaultImage plays the value of the form VideoPlayer. But I
don't see the form VideoPlayer on the GettingStarted form. How does
VideoPlayer overlay DefaultImage.
The answer is in your next question:

Quote:
I'm not sure why there are so many subforms. In the past these might
have simply been controls on a form. Perhaps all the splitting up is to
demonstratene features or perhaps make it work with the web?
No, they do not really have that many sub forms. However, to flip from that
image with a play button click, they simply flip the source object of a sub
form to one with a web control that displays the video. And the web url is a
tempvar, so they can display any video they want with that sub form. I mean
in place of open form, we just changing what displays in a single sub form.

We really only have:

Main form -> NavagationSubform ->sfrVideo

So, that is only 2 subform controls here.

So we just flip the sub form sfrVideo (we change the source object) between
a form called DefaultImage and Video player.

So, while we have a few forms, we only changing and dealing with one sub
form called sfrVideo

Even before a2010 and the nav control, we often see people switch the source
object of a control to change what displays in that sub form.

In web based systems, you really do not want to launch a separate browser
window since then you loose all control of where the user will return when
they close that new browser session. So, by flipping the sub form, the user
stays inside of the same form and therefore inside of the same browser. I
mean, 5 browsers open, which forms belong to yahoo and which belong to your
application? (you loose control real fast). So, keeping things inside of a
form is much recommended for web applications.

I should re-write that browseto command as a an VBA example as to how the
source object of the sub form is being changed, and then this would be more
clear.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
Pleasenospam_kallal (AT) msn (DOT) com

Reply With Quote
  #3  
Old   
Salad
 
Posts: n/a

Default Re: A2010. Question on macro - 02-13-2011 , 11:10 PM



Albert D. Kallal wrote:
Quote:
??"Salad" wrote in message
news:MKmdnZb6juA2oMnQnZ2dnUVZ_q2dnZ2d (AT) earthlink (DOT) com...

The macro for the OnClick event sets a tempvar callec tmpVideo and
sets the
value to a hyperlink. It then "BrowsesTo" a form called VideoPlayer and
has the path as
Main.NavigationSubform>GettingStarted.sfrVideo


The above path looks correct. We have the top form called Main. Then we
have
navcontorl called NavigationSubform. The browse to command "object" is
simply the name of the form in the navigation buttons we wan to work on.
(that nav button will become active if it is not).
I guess I am finding/determining what is and what is not a subform in
layout view a bit difficult. Web databases, near as I can make out,
don't have any design view.

Quote:
There is a form however called "Getting Started" that matches the tab
GettingStarted in form Main. May I assume NavigationSubform is an object
tab that was created from a Navigation form and then renamed?

NavigationSubform is the standard name of the sub form that used in all
navigation forms. In fact as a general rule, NavigationSubform is the
default name.
(so you could rename it, but it was not). Fire up a client application
and create
a nav form, and then bring I up in design view (as opposed to layout
view), you
will see the same defaulted sub form.

As always, remember a sub form is not really a form, but in fact just a
control
on a form (of which we can set the source object).
Just finding the form's property sheet seems to be a lesson in trial and
error. Click, check the property sheet, click elsewhere, check the
property sheet, and someday you get to the main form's property sheet
and not some navigation subform. It's easy enough to determine a
control like a command button. Finding the form's property sheet isn't.


Quote:
Ignoring that web forms use the new layout mode (introduced in 2007), those
sub forms do not work really any different then how Access and sub forms
in the past worked. In fact, the only real change here is a sub form
control can
now display a report (and this works for client VBA applications also). So
a navigation form is really just a set of buttons and then ONE sub form
called NavigationSubForm. You could change the name, but for coding
consistancity, I would not.

Thanks for the tip.

In form GettingStarted there is a subform with the name sfrVideo and the
control source Default Image. The form DefaultImage doesn't seem to be
anything more than a Play button.


Sure, since we can set the "sourceobject" of what will display in a
subform,
this is a nice easy way to have a image change occur. We just switch
the sub form from one that displays a image with a click event to one
that has a web control to the internet to display that view.

The image itself has the macro call'
Main.NavigationSubform>GettingStarted.sfrVideo


The above is correct. The way the browseto command works is you specify
which object on the nav pane you want to switch. I don't have time to
give a great explain here, and I simply have to get some sleep.
Once you played with the browseto command a few times, then it all makes
sense.
I kinda wish there was Intellysis for entering the path.
Quote:
In this case it somewhat more complex since we are setting the source
object of a subform
inside of a subform.

There are buttons that keep popping up on the forms while in layout mode
that have tiny crosses in square boxes. I suppose that button indicates
a subforms but that's just guessing. I wonder if there's a help topic
that covers icons...you know, the icon on the left, description on the
right? I can't find one.


No, the little + or cross hair means you are using a layout control. As
noted, these were introduced in a2007, and they help huge in reports and
forms for layouts.
I will say that in a web form, since you have to use layout view, then
they are not as helpful.
I'll have to lookup what a layout control is. As I mentioned earlier,
without any design mode for web layouts, finding a form, subform, and
perhaps a control can be a pain.
Quote:
Anyway, DefaultImage plays the value of the form VideoPlayer. But I
don't see the form VideoPlayer on the GettingStarted form. How does
VideoPlayer overlay DefaultImage.


The answer is in your next question:

I'm not sure why there are so many subforms. In the past these might
have simply been controls on a form. Perhaps all the splitting up is to
demonstratene features or perhaps make it work with the web?


No, they do not really have that many sub forms. However, to flip from
that image with a play button click, they simply flip the source object
of a sub form to one with a web control that displays the video. And the
web url is a tempvar, so they can display any video they want with that
sub form. I mean in place of open form, we just changing what displays
in a single sub form.

We really only have:

Main form -> NavagationSubform ->sfrVideo

So, that is only 2 subform controls here.

So we just flip the sub form sfrVideo (we change the source object)
between a form called DefaultImage and Video player.

So, while we have a few forms, we only changing and dealing with one sub
form called sfrVideo

Even before a2010 and the nav control, we often see people switch the
source object of a control to change what displays in that sub form.

In web based systems, you really do not want to launch a separate
browser window since then you loose all control of where the user will
return when they close that new browser session. So, by flipping the sub
form, the user stays inside of the same form and therefore inside of the
same browser. I mean, 5 browsers open, which forms belong to yahoo and
which belong to your application? (you loose control real fast). So,
keeping things inside of a form is much recommended for web applications.

I should re-write that browseto command as a an VBA example as to how
the source object of the sub form is being changed, and then this would
be more clear.

I wish the Contacts database was done both in Regular and Web so one can
spot what's going on easier.

Thanks for your input.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.