Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

OnClick Event Procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sondra - 15 Mar 2005 20:23 GMT
I have an edit form that I want to create a command button
on that will close the form and reopen it.  The reason
being that the form is run on a criteria query that asks
the user to enter the document number they want to
update.  I wrote a macro that closes the form and reopens
it, and that seems to work, but I would prefer to have an
onclick function.

Any help would be appreciated.

Thanks.

Sondra
American Red Cross
Give the Gift of Life Donate Blood
SusanV - 15 Mar 2005 20:35 GMT
I have a similar form (for searching) and I added a new button (Search
again) and simply used the wizard to have it open the same form. Seems to
work well - the original instance closes and the user is presented with the
criteria box.

Signature

hth,
SusanV

>I have an edit form that I want to create a command button
> on that will close the form and reopen it.  The reason
[quoted text clipped - 11 lines]
> American Red Cross
> Give the Gift of Life Donate Blood
anonymous@discussions.microsoft.com - 15 Mar 2005 20:52 GMT
I attempted this, but it doesn't run my criteria from my
query.  What might I be doing wrong?  

I put a new command button on
The wizard asked for my information
I chose open new form
Chose the name of my form
Asked if I wanted to open all records or specific record.

I entered all records with the hopes it would run the
query and ask my criteria.

No luck.

any advise??
>-----Original Message-----
>I have a similar form (for searching) and I added a new button (Search
[quoted text clipped - 19 lines]
>
>.
SusanV - 15 Mar 2005 21:37 GMT
I have the form based on a query, and the MCode field (number) is what they
are searching for in the query:

Like '*' & [Enter the MCode you would like to view please] & '*'

All other fields are simply viewable, with no further definition. They can
also search the MCode Title  by keyword using the same query layout, but the
field Title is set to this criteria:

Like '*' & [Enter a keyword to search by please] & '*'

I hope that helps, I'm not sure if I've been clear...

Susan

>I attempted this, but it doesn't run my criteria from my
> query.  What might I be doing wrong?
[quoted text clipped - 40 lines]
>>
>>.
SusanV - 15 Mar 2005 21:47 GMT
I meant a different query using the same layout, sorry

>I have the form based on a query, and the MCode field (number) is what they
>are searching for in the query:
[quoted text clipped - 55 lines]
>>>
>>>.
Mark - 15 Mar 2005 20:37 GMT
Instead of closing the form and reopeing it, why not just change the record
source and then requery the form?
Off the top of my head, something like:

intDocNum=Inputbox("Enter a document number")
strSQL="Select * From MyDocumentsTable Where DocumentNumber = " & intDocNum
Me.RecordSource=strSQL
Me.Requery

>I have an edit form that I want to create a command button
> on that will close the form and reopen it.  The reason
[quoted text clipped - 11 lines]
> American Red Cross
> Give the Gift of Life Donate Blood
Sondra - 15 Mar 2005 21:04 GMT
Help:

I tried this and it seemed to be okay until I got to this
line:

Me.RecordSource=strSQL

What is this??

Thanks.

>-----Original Message-----
>Instead of closing the form and reopeing it, why not just change the record
[quoted text clipped - 23 lines]
>
>.
Mark - 15 Mar 2005 21:30 GMT
Me.RecordSource=strSQL should set the form's record source to the new query
definition made in the line that starts out with strSQL="Select..." Since I
made up this code in my head and didn't test it, the syntax most likely
needs a little tweaking.  Try building the query with the query builder, and
put a value in the criteria row for the document number field.  View the
query as SQL and note how it's put together.  You can copy it and paste it
into the VBA code and fine tune it to work.  It probably needs some
parentheses or other punctuation.

> Help:
>
[quoted text clipped - 39 lines]
>>
>>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.