Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
How to create a command button on a data access page that runs a query/macro/module?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Weinberger  
View profile  
 More options May 29 2002, 9:25 am
Newsgroups: microsoft.public.scripting.vbscript
From: Peter Weinberger <peter.weinber...@comverse.com>
Date: Wed, 29 May 2002 06:21:54 -0700
Local: Wed, May 29 2002 9:21 am
Subject: How to create a command button on a data access page that runs a query/macro/module?
Tried DoCmd but I am not sure how to integrate visual basic code into
vb/jscript, so I might have used the wrong syntax....

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex_k._angelopoulos_(mvp)  
View profile  
 More options May 30 2002, 8:53 pm
Newsgroups: microsoft.public.scripting.vbscript
From: <Alex K. Angelopoulos (MVP)>
Date: Thu, 30 May 2002 19:51:36 -0500
Local: Thurs, May 30 2002 8:51 pm
Subject: Re: How to create a command button on a data access page that runs a query/macro/module?
Could you post what you are using?

"Peter Weinberger" <peter.weinber...@comverse.com> wrote in message

news:O3RJOPxBCHA.2572@tkmsftngp05...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Weinberger  
View profile  
 More options Jun 3 2002, 3:01 am
Newsgroups: microsoft.public.scripting.vbscript
From: Peter Weinberger <peter.weinber...@comverse.com>
Date: Sun, 02 Jun 2002 23:57:35 -0700
Local: Mon, Jun 3 2002 2:57 am
Subject: Re: How to create a command button on a data access page that runs a query/macro/module?

Tx for replying. I wrote the code according to what I understood from
the Access help pages on DoCmd, but several experiments were fruitless,
so I deleted it afterwards. What I need is the right code that connects
to the database and trigger a few queries. I could then append this code
to an existing button.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex_k._angelopoulos_(mvp)  
View profile  
 More options Jun 3 2002, 9:23 am
Newsgroups: microsoft.public.scripting.vbscript
From: <Alex K. Angelopoulos (MVP)>
Date: Mon, 3 Jun 2002 08:22:05 -0500
Local: Mon, Jun 3 2002 9:22 am
Subject: Re: How to create a command button on a data access page that runs a query/macro/module?
That's pretty hard for a non-Access person to do! I could help with converting
something that works in Access over to VBScript, but since I don't know enough
of the Access object model, I don't even have a clue where to start.

Have you tried finding a working in-Access example?  If you have a working
database to start with, one of the Access groups could probably help you put
together a reasonable facsimile which can then be turned into script.

"Peter Weinberger" <peter.weinber...@comverse.com> wrote in message

news:#RLpxvsCCHA.1560@tkmsftngp02...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Weinberger  
View profile  
 More options Jun 4 2002, 7:41 am
Newsgroups: microsoft.public.scripting.vbscript
From: Peter Weinberger <peter.weinber...@comverse.com>
Date: Tue, 04 Jun 2002 04:37:52 -0700
Local: Tues, Jun 4 2002 7:37 am
Subject: Re: How to create a command button on a data access page that runs a query/macro/module?

[This is how I tried to integrate Visual Basic code into my access page
(without success):]

<SCRIPT language=VBS event=onclick for=Command11>
<!--
Function maskmacro()
On Error GoTo maskmacro_Err

    DoCmd.OpenQuery "qrymask", acNormal, acAdd
    DoCmd.OpenQuery "qrydelmask", acNormal, acEdit

maskmacro_Exit:
    Exit Function

maskmacro_Err:
    MsgBox Error$
    Resume maskmacro_Exit

End Function

-->
</SCRIPT>

[This is how Access automatically creates code in jscript that
manipulates the database:]

<SCRIPT language=javascript event=onclick for=Command9>
try { MSODSC.CurrentSection.DataPage.Save(); }
[MSODSC.somethingelse.method/function to trigger
query???????????????????????????????????????????????????????????????????
]
catch (e)
{ alert (e.description);}
</SCRIPT>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex_k._angelopoulos_(mvp)  
View profile  
 More options Jun 4 2002, 8:50 am
Newsgroups: microsoft.public.scripting.vbscript
From: <Alex K. Angelopoulos (MVP)>
Date: Tue, 4 Jun 2002 07:49:46 -0500
Local: Tues, Jun 4 2002 8:49 am
Subject: Re: How to create a command button on a data access page that runs a query/macro/module?
Wow... that looks utterly alien.

Here's a minor modification of your first function as a "pure" VBScript; it can
be saved and run interactively as mask.vbs.  It is not exactly what you want,
I'm sure, but the key thing is getting you to know the differences in VBScript;
in many ways it is easier than VB or VBA, once you know its idiosyncrasies.

Very simple error control: you can toggle off breaking on errors with "On Error
Resume Next", and turn it back on with "On Error Goto 0".  You can't branch on
errors, unfortunately.

You have to instantiate something you are going to use.  This is probably a moot
point; you have an object ref to Access or something in your page; for a
client-side script example,we have to instantiate it below.  If your object's ID
is "Acc", the code should look an awful lot like this.

On Error Resume Next
Set Acc = GetObject("C:\temp\scripting.mdb")
Acc.Visible = True
Const acAdd = 0, acEdit = 1, acNormal = 0
Acc.DoCmd.OpenQuery "qrymask", acNormal, acAdd
Acc.DoCmd.OpenQuery "qrydelmask", acNormal, acEdit
Acc.UserControl = True
MsgBox Err.Number & Err.Source & Err.Description
Err.Clear

"Peter Weinberger" <peter.weinber...@comverse.com> wrote in message

news:Oys3Dx7CCHA.2072@tkmsftngp02...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »