Share via

refresh button on form that views as split form

Anonymous
2012-03-21T01:49:12+00:00

Hi

I have a form that views as a split form, with the datasheet view on the bottom of the form.  In the top section I have txt boxes created in order to use as an unbound form to enter data into, which my query then reads from and returns the subset of data that I want, this is displayed in the bottom of this form in the datasheet view.  so this form has the record source of my query. this is all good and works fine... here is the  problem...

when I use the default refresh button at the top of access in the "quick access toolbar" it works great, and it runs the query and displays the results in the bottom of my split form in datasheet view.  so I created a button on my split form "refresh" from the create button in design view, and it doesn't work at all.  I then did some fiddling around with some macros, but to no avail.

can someone point me in the right direction please to get this working.

form name: frmTransmittalFilter

query name: qryFilter_For_Transmittals

the form frmTransmittalFilter is based n the qryFilter_For_Transmittals as the record source.  It is a split form, with unbound txt boxes up the top to enter the criteria to return the subset of data that I require, and the bottom of the split form is datasheet view, which displays the records, but I am wanting to hit the refresh button to update the results in this datasheet view, which as I previously said works perfectly in the "quick access toolbar", but when I created my own refresh button on the form it does nothing.

so the objective is to get this refresh button to work on my form.

thanks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-03-27T05:39:22+00:00

You do not want to open the query again.  All you want to do is requery the form.  In VBA code this would be:

    Forms!frmTransmittalFilter.Requery

In a macro, the action would be:

    SelectObject

        Object Type: Form

        Object Name: frmTransmittalFilter

        In Database Window: No

    Requery

         Control Name: (leave blank)

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-03-27T05:53:39+00:00

    Dirk,

    thanks so much .... I used the Macro action and it works perfectly.

    Many Hugs and Kisses

    thanks

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-03-27T05:08:47+00:00

    hmmm yeah that sounds about right.

    My code executes a query, so yeah I guess your right.

    Not familiar with this process, how do I go about it?  I tried doing a macro that I thought would work, by opening/ running the query and closing and opening it again, this did work but it opened the query in a new tab, where as I want the query to update the information in my form that is already open and my datasheet view down the bottom where my results are.

    form name: frmTransmittalFilter

    query name: qryFilter_For_Transmittals

    Here is my SQL

    PARAMETERS Forms!frmTransmittalFilter!txtAndtraTransmittalDate DateTime, Forms!frmTransmittalFilter!txtAndtraDateCreated DateTime;

    SELECT tblTracking.traDocNo, tblTracking.traRevNo, tblTracking.traOwner, tblTracking.traRevisionDate, tblTracking.traStatus, tblTracking.traSentReceived, tblTracking.traToFrom, tblTracking.traCompany, tblTracking.traTransmittalDate, tblTracking.traTransmittalNo, tblTracking.traNotes, tblTracking.traDateCreated, tblTracking.traSelect, tblDocuments.docTitle

    FROM tblDocuments LEFT JOIN tblTracking ON tblDocuments.docDocNo = tblTracking.traDocNo

    WHERE ((tblTracking.traDocNo Like "*" & Forms!frmTransmittalFilter!txtdocDocNoFrom_Update & "*" Or Forms!frmTransmittalFilter!txtdocDocNoFrom_Update Is Null)

    And (tblTracking.traDocNo<=Forms!frmTransmittalFilter!txtdocDocNoTo_Update Or Forms!frmTransmittalFilter!txtdocDocNoTo_Update Is Null))

    And (tblDocuments.docTitle Like Forms!frmTransmittalFilter!txtAnddocTitle & "*" Or Forms!frmTransmittalFilter!txtAnddocTitle Is Null)

    And (tblTracking.traRevNo Like Forms!frmTransmittalFilter!txtAndtraRevNo & "*" Or Forms!frmTransmittalFilter!txtAndtraRevNo Is Null)

    And (tblTracking.traStatus Like Forms!frmTransmittalFilter!txtAndtraStatus & "*" Or Forms!frmTransmittalFilter!txtAndtraStatus Is Null)

    And (tblTracking.traOwner Like Forms!frmTransmittalFilter!txtAndtraOwner & "*" Or Forms!frmTransmittalFilter!txtAndtraOwner Is Null)

    And ((tblTracking.traRevisionDate>=Forms!frmTransmittalFilter!txtAndtraRevisionDate And tblTracking.traRevisionDate<Forms!frmTransmittalFilter!txtAndtraRevisionDate+1) Or Forms!frmTransmittalFilter!txtAndtraRevisionDate Is Null)

    And (tblTracking.traSentReceived Like Forms!frmTransmittalFilter!txtAndtraSentReceived & "*" Or Forms!frmTransmittalFilter!txtAndtraSentReceived Is Null)

    And (tblTracking.traToFrom Like Forms!frmTransmittalFilter!txtAndtraToFrom & "*" Or Forms!frmTransmittalFilter!txtAndtraToFrom Is Null)

    And (tblTracking.traCompany Like Forms!frmTransmittalFilter!txtAndtraCompany & "*" Or Forms!frmTransmittalFilter!txtAndtraCompany Is Null)

    And ((tblTracking.traTransmittalDate>=Forms!frmTransmittalFilter!txtAndtraTransmittalDate And tblTracking.traTransmittalDate<Forms!frmTransmittalFilter!txtAndtraTransmittalDate+1) Or Forms!frmTransmittalFilter!txtAndtraTransmittalDate Is Null)

     And (tblTracking.traTransmittalNo Like "*" & Forms!frmTransmittalFilter!txtAndtraTransmittalNo & "*" Or Forms!frmTransmittalFilter!txtAndtraTransmittalNo Is Null)

     And (tblTracking.traNotes Like "*" & Forms!frmTransmittalFilter!txtAndtraNotes & "*" Or Forms!frmTransmittalFilter!txtAndtraNotes Is Null)

     And ((tblTracking.traDateCreated>=Forms!frmTransmittalFilter!txtAndtraDateCreated And tblTracking.traDateCreated<Forms!frmTransmittalFilter!txtAndtraDateCreated+1) Or Forms!frmTransmittalFilter!txtAndtraDateCreated Is Null)

    ORDER BY tblTracking.traDocNo;

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-03-27T05:00:54+00:00

    What macro or code does your refresh button execute?  I would think that it needs to execute a Requery action, not a Refresh action.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-03-27T04:33:26+00:00

    Can someone help me? please

    Was this answer helpful?

    0 comments No comments