dbTalk Databases Forums  

Access 2010 Contacts Web database template question.

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


Discuss Access 2010 Contacts Web database template question. in the comp.databases.ms-access forum.



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

Default Access 2010 Contacts Web database template question. - 02-13-2011 , 11:14 PM






When you open the Contacts Web Database it opens immediately to the
GetStarted tab, the forth tab on the form. I have looked under
File/Options and see the opening form is Main. But I see nothing that
"starts it" on the GettingStarted tab. Since there is no code one can't
easily look for a Form_Open routine that might start that tab as the
first. Does anybody have an idea of why it opens on the GettingStarted tab?

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 12:37 AM






?"Salad" wrote in message
news:xYydnS-etq3PJ8XQnZ2dnUVZ_s6dnZ2d (AT) earthlink (DOT) com...

Quote:
Does anybody have an idea of why it opens on the GettingStarted tab?
Yes, the first form that loads in the nav control is ContactCard.

If you look at the on load event of that form, it executes a browseto
command to make the 4th Getting started tab active.

In fact, this is a far more traditional use of the browse to command, and is
far more easy to understand.

While the browse to command is macro code, I shall re write that code as VBA
for you.

We shall assume we have a global var called tmpFirstVist as a Boolean.

Also, there is a browseto command in VBA, the format is:

DoCmd.BrowseTo acBrowseToForm, _
"Form to load or make Active in the nav control set",
_
"Name of Navigation Sub form to act on", _
"a where condition just like in open form"

As I said, the challenge in web based systems is you have to toss out the
idea of one form opening another form that then opens another form. The
reason being is we do not want each separate form to become a new separate
browser window. It becomes impossible to force the user to close one browser
to return to another browser. As noted, one browser open could be your form,
and the other one might be a Google search and the other might be eBay. So
you want to keep the user inside of ONE browser launched.

If you look close at the above browse to command, it also even has a where
clause. So, browse to is much what you want to use in place of open form (at
least when you do not want a new browser session to open + launch).

So, now, re writing the Macro code in VBA we get:

if isnull(tmpFirstVist) And Isnull([ID]) Then

DoCmd.BrowseTo acBrowseToForm, _
"GettingStarted", _
"Main.NavagationSubForm"

tempFirstVist = True

End if

So, this browse to command simply says please browse to a form called
GettingStarted, and that is to occur in the Nav control subform called
Main.NavagationSubForm.

Note that I should point out that if you specify a form THAT IS NOT PART of
the NavContorl, then the form WILL OPEN ANYWAY. What the browseto does is
simply replace the CURRENT form in the NavagationSubForm. that is
highlighted in the nav set.

So, keep in mind THAT WHEN the form exists in the Navigation form, then the
tab in that nav form becomes active and selected and highlighted and the
form displays. So, browse to is NOT limited to the case where the form
exists in the Navigation control. While in many or most cases browseto will
be used to highlight what form is to be displayed in the nav control such as
in the above example, it is not limited as such. As noted, in the previous
example, browseto was used to change the sub form from the image sub form to
the video player form.

So, browse ALWAYS operates on a sub form. And it can be also a sub form
inside of a sub form such as for the video play example.

So what tab becomes highlighted became highlighted ONLY due to the fact that
the form exists in the Nav control set.

As noted, if that form specified in the browseto is NOT part of the
navagation control set, then the sub form control where we specify the form
to be loaded into will still work, but the active tab will not change.

So, think of browseto as simply a open form command, but you ALWAYS LOAD
that form into a subform.
We do it this way since we do not want a new browser window to open when we
open a form.

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

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 07:01 AM



On Feb 14, 12:14*am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
When you open the Contacts Web Database it opens immediately to the
GetStarted tab, the forth tab on the form. *I have looked under
File/Options and see the opening form is Main. *But I see nothing that
"starts it" on the GettingStarted tab. *Since there is no code one can't
easily look for a Form_Open routine that might start that tab as the
first. *Does anybody have an idea of why it opens on the GettingStartedtab?
If you open the Contact database and look at the navagation pane on
the left side of the screen you'll notice a macro called Autoexec. If
you open this macro you will see that the form GettingStarted is
called. I changed this to the ContactDetail form. When the database
was started again it started with the new form instead.

Charlie
cphelan (AT) cdpinfo (DOT) com
www.cdpinfo.om

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 07:34 AM



?"Charlie" wrote in message
news:129c0a46-cdea-4277-986d-870eac4b311f (AT) l12g2000pra (DOT) googlegroups.com...

Quote:
If you open the Contact database and look at the navagation pane on
the left side of the screen you'll notice a macro called Autoexec.
No, he asking and talking about a web browser based edition of Access 2010.

New for Access 2010 is the ability to create web based applications.

So, unless you running 2010, you not see the option or choice for a web
based template.

Quote:
If you open this macro you will see that the form GettingStarted is
called.

In the Web Based edition, there is not AutoExec Macro, and even if there
was, it would not have applied to the Web forms, but only to client based
forms.

In Access 2010, you can now build browser based applications. Here is a you
tube video, and note how at the half way point I switch to running the
application in a web browser:

http://www.youtube.com/watch?v=AU4mH0jPntI

So, in this question, the Active tab in the sample Web Contacts is changed
by using the new browseto command.

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

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 09:50 AM



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

Does anybody have an idea of why it opens on the GettingStarted tab?


Yes, the first form that loads in the nav control is ContactCard.

If you look at the on load event of that form, it executes a browseto
command to make the 4th Getting started tab active.

In fact, this is a far more traditional use of the browse to command,
and is far more easy to understand.

While the browse to command is macro code, I shall re write that code as
VBA for you.

We shall assume we have a global var called tmpFirstVist as a Boolean.

Also, there is a browseto command in VBA, the format is:

DoCmd.BrowseTo acBrowseToForm, _
"Form to load or make Active in the nav control
set", _
"Name of Navigation Sub form to act on", _
"a where condition just like in open form"

As I said, the challenge in web based systems is you have to toss out
the idea of one form opening another form that then opens another form.
The reason being is we do not want each separate form to become a new
separate browser window. It becomes impossible to force the user to
close one browser to return to another browser. As noted, one browser
open could be your form, and the other one might be a Google search and
the other might be eBay. So you want to keep the user inside of ONE
browser launched.

If you look close at the above browse to command, it also even has a
where clause. So, browse to is much what you want to use in place of
open form (at least when you do not want a new browser session to open +
launch).

So, now, re writing the Macro code in VBA we get:

if isnull(tmpFirstVist) And Isnull([ID]) Then

DoCmd.BrowseTo acBrowseToForm, _
"GettingStarted", _
"Main.NavagationSubForm"

tempFirstVist = True

End if

So, this browse to command simply says please browse to a form called
GettingStarted, and that is to occur in the Nav control subform called
Main.NavagationSubForm.

Note that I should point out that if you specify a form THAT IS NOT PART
of the NavContorl, then the form WILL OPEN ANYWAY. What the browseto
does is simply replace the CURRENT form in the NavagationSubForm. that
is highlighted in the nav set.

So, keep in mind THAT WHEN the form exists in the Navigation form, then
the tab in that nav form becomes active and selected and highlighted and
the form displays. So, browse to is NOT limited to the case where the
form exists in the Navigation control. While in many or most cases
browseto will be used to highlight what form is to be displayed in the
nav control such as in the above example, it is not limited as such. As
noted, in the previous example, browseto was used to change the sub form
from the image sub form to the video player form.

So, browse ALWAYS operates on a sub form. And it can be also a sub form
inside of a sub form such as for the video play example.

So what tab becomes highlighted became highlighted ONLY due to the fact
that the form exists in the Nav control set.

As noted, if that form specified in the browseto is NOT part of the
navagation control set, then the sub form control where we specify the
form to be loaded into will still work, but the active tab will not change.

So, think of browseto as simply a open form command, but you ALWAYS LOAD
that form into a subform.
We do it this way since we do not want a new browser window to open when
we open a form.

Hi Albert: Thanks for the update. I know I have some confusion with
the new design. If I close all the forms, open the navigation bar, and
right-click the Main form and select Layout view, the form is presented.

I see the "Main" tab, then a label "Contacts Web Database", and then the
Navigation bar. If I click the design tab and select Property sheet I
get the property sheet for form Main. There appears to be no button to
select "Form" for form Main, I seems must use the combo dropdown in the
property sheet. When I have form Main's property sheet open I see
there's no events for that. So I select NavigationSubform from the
property sheet. There are no events for those tabs on the
NavigationSubform. Is the real information stored under the Data tab in
the NavigationTargetName?

I was thinking there'd be an easy methiod to reorder the tabs on the
navigation form. There's no "Reorder" window, no indexes I see. I use
the left mouse to drag the tab to a new postion. Sometimes it works,
other times not.

I now see the Onload macro in Contact card. It has the line
If Isnull(Tampvars!TmpFirstVisit)...
Browseto...
Set Tempvar tmpFirstVisit True
Endif

That seems odd. How can TmpFirstVistit be null when it hasn't been
initialized? Or was it initialized elsewhere? Or do tempvars even need
to be initialized?

On the AddNew tab of contact card the Macro for it starts off with
On Error (Fail,).
which expands to Goto Fail. Since there are no macros in the database,
where is Fail located? Does one go to every control in the database to
find Fail or is there an easy way to find Fail?

Thanks for any insight you might provide.

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 09:55 AM



Charlie wrote:

Quote:
On Feb 14, 12:14 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

When you open the Contacts Web Database it opens immediately to the
GetStarted tab, the forth tab on the form. I have looked under
File/Options and see the opening form is Main. But I see nothing that
"starts it" on the GettingStarted tab. Since there is no code one can't
easily look for a Form_Open routine that might start that tab as the
first. Does anybody have an idea of why it opens on the GettingStarted tab?


If you open the Contact database and look at the navagation pane on
the left side of the screen you'll notice a macro called Autoexec. If
you open this macro you will see that the form GettingStarted is
called. I changed this to the ContactDetail form. When the database
was started again it started with the new form instead.

Charlie
cphelan (AT) cdpinfo (DOT) com
www.cdpinfo.om
If I click on the Navigation pane there are no macros. Not for the
ContactsWeb database. I've selected AllObjects and did a search for
AutoExec and that didn't return anything.

Did the team provide 2 templates; Plain and Web? If there are 2
versions that'd be nice.

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 01:22 PM



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

Quote:
If I click the design tab and select Property sheet I get the property
sheet for form Main. There appears to be no button to select "Form" for
form Main, I seems must use the combo dropdown in the
property sheet.

Yes, the above is a bit annoying. It selects the FIRST control on the form.
I guess most of the time one going to modify contorls on a form.
However, yes to thus to select the form, you have to use the drop down.

I now just click in the combo box, and with my left hand hit f + tab key. I
do this now without even thinking about it.

Quote:
There are no events for those tabs on the NavigationSubform.
No, there is not. However, if you switch a tab, then the forms on load
command is going to run. So, not a big problem.

Quote:
Is the real information stored under the Data tab in the
NavigationTargetName?
Not really. All that is occurring here is when you click on a nav choice,
the subform source object is changed to the form we want. You could have
coded very much the same effect in the past with VBA and setting the source
object of the Navigation Subfom - this nav system simply does that for you,
and also includes the possible where clause if you want.

Try clicking on one of the button choices in that nav set and then note the
property sheet - (the data tab on that sheet), you see the property called

"Navigation Target Name",
and
"Navigation Where Clause"

Quote:
I was thinking there'd be an easy methiod to reorder the tabs on the
navigation form. There's no "Reorder" window, no indexes I see. I use the
left mouse to drag the tab to a new postion. Sometimes it works, other
times not.
Highlight the one button, then click and hold, now try dragging/moving it to
the left, NOTE CLOSE the orange vertical bar - that is standard when using a
layout control as to where the control will be dropped. In this case since
the moving can only be left or right, then make sure you do not drag up/down
else you not see where the orange insert bar is going to show.

Quote:
That seems odd. How can TmpFirstVistit be null when it hasn't been
initialized?
it is null when not yet initialized.

Quote:
On the AddNew tab of contact card the Macro for it starts off with
On Error (Fail,).
Did you try the combo drop down of options? You get 3 choices:

Next
Macro Name
Fail

If you choose Macro Name from above, then you are to fill out the next part
of the macro command Called Macro Name. If you choose Next, or Fail, then
you do not need to supply the macro name.

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

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 01:29 PM



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

Quote:
Did the team provide 2 templates; Plain and Web? If there are 2 versions
that'd be nice.
Launch Access, you see two rows of choices

1st row = Blank database, Blank Web Database, Recent Templates etc.

2nd row = Assets, Contacts, Issues & Tasks etc.


So, in the above 2nd row, the Contacts database is a non web based version.
I not looked and I not sure if they are functional equivalents anyway, but
there is a web and non web version of that template.

There is also a web version of the North wind traders here:

http://blogs.office.com/b/microsoft-...available.aspx

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

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

Default Re: Access 2010 Contacts Web database template question. - 02-14-2011 , 04:27 PM



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

If I click the design tab and select Property sheet I get the property
sheet for form Main. There appears to be no button to select "Form"
for form Main, I seems must use the combo dropdown in the

property sheet.

Yes, the above is a bit annoying. It selects the FIRST control on the
form. I guess most of the time one going to modify contorls on a form.
However, yes to thus to select the form, you have to use the drop down.

I now just click in the combo box, and with my left hand hit f + tab
key. I do this now without even thinking about it.

There are no events for those tabs on the NavigationSubform.


No, there is not. However, if you switch a tab, then the forms on load
command is going to run. So, not a big problem.

Is the real information stored under the Data tab in the
NavigationTargetName?


Not really. All that is occurring here is when you click on a nav
choice, the subform source object is changed to the form we want. You
could have coded very much the same effect in the past with VBA and
setting the source object of the Navigation Subfom - this nav system
simply does that for you, and also includes the possible where clause if
you want.

Try clicking on one of the button choices in that nav set and then note
the property sheet - (the data tab on that sheet), you see the property
called

"Navigation Target Name",
and
"Navigation Where Clause"

I was thinking there'd be an easy methiod to reorder the tabs on the
navigation form. There's no "Reorder" window, no indexes I see. I
use the left mouse to drag the tab to a new postion. Sometimes it
works, other times not.


Highlight the one button, then click and hold, now try dragging/moving
it to the left, NOTE CLOSE the orange vertical bar - that is standard
when using a layout control as to where the control will be dropped. In
this case since the moving can only be left or right, then make sure you
do not drag up/down else you not see where the orange insert bar is
going to show.

That seems odd. How can TmpFirstVistit be null when it hasn't been
initialized?


it is null when not yet initialized.

On the AddNew tab of contact card the Macro for it starts off with
On Error (Fail,).


Did you try the combo drop down of options? You get 3 choices:

Next
Macro Name
Fail

If you choose Macro Name from above, then you are to fill out the next
part of the macro command Called Macro Name. If you choose Next, or
Fail, then you do not need to supply the macro name.

Excellent. I have two questions from above regarding the macro statement
"IsNull([TempVars]![tmpFirstVisit]) And IsNull([ID])"

I said: That seems odd. How can TmpFirstVistit be null when it hasn't
been initialized?

You replied: it is null when not yet initialized.

So if I had a statement like
If Isnull([Tempvars]![Junk]) and I haven't declared it (this being the
first and Only reference to Junk in any macro within the database, it
would evaluate as null? Declaration is not necessary?

Second, the statement has IsNUll([ID]). Looking at the form there is no
ID field on the form. There is [ID] as part of the recordsource. In
the property sheet the name is "txtID". No way, near as I can tell, of
looking at the table structure as there's no design view of the table.
But it's an autonumber. So, ControlSource ID, Name txtID. A little
odd. Anyway txtID is an invisible field. I would have thought the
IsNull([ID]) would be IsNull([txtID]).

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

Default Re: Access 2010 Contacts Web database template question. - 02-15-2011 , 12:10 PM



?"Salad" wrote in message
news:TI-dnbeGHvikMcTQnZ2dnUVZ_uKdnZ2d (AT) earthlink (DOT) com...


Quote:
Excellent. I have two questions from above regarding the macro statement
"IsNull([TempVars]![tmpFirstVisit]) And IsNull([ID])"

I said: That seems odd. How can TmpFirstVistit be null when it hasn't
been initialized?

You replied: it is null when not yet initialized.

So if I had a statement like
If Isnull([Tempvars]![Junk]) and I haven't declared it (this being the
first and Only reference to Junk in any macro within the database, it would
evaluate as null? Declaration is not necessary?
Correct, it is null and declaration is not necessary. Access 2007
macros also work this way. So, tempvars are null, and there is no
option explicit or need to declare before first use. They are much
considered variant type. It is however often a good idea to assign
the tempvar a value so it's data type is set.

So, this is much how macros work, and I do not believe this is any
change from 2007 macros.

Quote:
Second, the statement has IsNUll([ID]). Looking at the form there is no ID
field on the form. There is [ID] as part of the recordsource.
You always been even in regular version of Access been able to reference
columns in the database without having to place the control on the form, so
this is nothing new.
And you always been able to do this without using ME!ID or ME("ID"). You can
also use [ID] or even ID

However, I had a few cases where referencing the underlying column in Access
web did not work, so I as a general rule I recommend placing the control on
the form, and if you
do not want users to see it, then set visible = false.

Quote:
the property sheet the name is "txtID".
That is a sub form, and the form is NameCard

Quote:
No way, near as I can tell, of looking at the table structure as there's no
design view of the table.
The above is not clear to me? You are correct there is no design view for
web tables, but I am not really sure as to what information you were trying
to find in the table that you could not find anyway?
That table view was also introduced in a2007. I would prefer the old design
view, but the new table view was used since it has to connect and talk to
SharePoint.

Quote:
But it's an autonumber. So, ControlSource ID, Name txtID. A little odd.
Actually, a good number of Access developers as a general rule use different
names for the text box and controls as compared to what the underlying
columns are. This development approach ensures that there is no confusing
when you reference a control vs that of column in the table.

Quote:
Anyway txtID is an invisible field. I would have thought the IsNull([ID])
would be IsNull([txtID]).
No, because that is an sub form and the code we talking about is running in
the main form. And, I betting that the control is not visible since as I
noted often I seen problems when you try to use a value of the underlying
table without a control. So, in this case, the control txtID is placed on
the form, but we are talking about a different form here (NameCard), while
the on load code is running in the parent form called Contact Card.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
Pleasenospam_kallal (AT) msn (DOT) com

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.