Refresh a DBGrid VB6 - ms-access

I'm trying to refresh my DBGrid after I've clicked a button to delete all the data. I've tried refresh with no results. I've tried Refresh on the DBGrid1 and on the Data object and even on the Form.

What I did was just gave them a pop-up indicating the action was complete and then closed the form. If they want to look at the blank list, they can click on the button to view it again.

Related

How to display the results of a search Query (done by clicking a "Search" Button) in a Subform?

I'm working on a DB in Microsoft Access 2016 and created a search form with multiple filters and then a Search button. It works perfectly fine, it shows the results in a query table that opens separately but I would like the results to be shown on the form page right below the button.
I tried:
creating a list box and setting the row source to my query
dragging the query itself on my form page to create a subquery and it only every data in the DB. The query is still functional, it opens in another tab and works, but the subform doesn't change at all
creating a combo box and displaying the results after pressing the button in the said combo box
adding another button in the subform to run the query but it has the same outcome: results displayed in a separate tab.
pic of what I want my form to do
I attached a pic, that's not my actual DB. Basically I want the box to display my results only after clicking the button.
Nothing has worked :( is there anything else I could try? I would gladly post my .accdb file if it's easier to understand what I mean.
Thank you!

Why MS Access pop up form doesn't regain focus after switching apps with Alt-Tab?

I have an Access 2016 application that opens a pop-up form when user double-clicks on a record in a datasheet form. That's meant to be a 'detail form' showing all fields in record (datasheet shows only a few). Now, while editing data on popup form, I switch to another app (say Notepad) to copy some text from there or simply check some other thing. I then switch back to Access app by applying Alt-Tab. However, now focus is over datasheet form, instead of pop up form it was when I first switched to Notepad.
Can anyone please help on understanding why this happens? Ultimately I want to return focus over popup form whenever I switch back from any other app by using Alt-Tab, i.e., maybe by detecting in VBA when Access application gets focus back so I can set focus on desired form. I've read some suggestions about using some Windows API function but no detailed examples on that.
Any help will be greatly appreciated.

Requery of subform does not activate conditional formatting and puts new record at the bottom

I have a form with a 2-page tab control.
The first page has a subform with a button on the subform that's supposed to requery another subform that is on the second page.
Forms!myMainForm!mySubForm.Requery
The main form and its fields are used to create new records and the subform on the second page shows these records.
Here's a screenshot of page 1's subform and button:
http://i.imgur.com/RLsgcSi.jpg
When the button is clicked, the subform on the second page shows any new record at the bottom of the list instead of being sorted in descending date/time order. Also the Funding Rate field does not seem to get its conditional formatting applied:
http://i.imgur.com/QRvI5fy.jpg
I've been able to get the subform to display correctly if I also add some VBA to the button to switch to the second page of the tab, but I'd rather not do this.
Is it possible to requery a subform and have it display correctly when the user is ready to see it?
Migrate froms Tabs to Navigation Control. Usual Tabs are preloaded and will increase the main form load time. On the other hand, Navigation control only loads the form when its opened. This eliminates your needs to manually re-query the second tab.
PS: I'm interested in something in your form, what is your best contact method?
Forms!myMainForm!mySubForm.Requery
This requeries the mySubForm control on myMainForm, but not the subform itself.
Try instead:
Forms!myMainForm!mySubForm.Form.Requery
(note: I'm not 100% sure this will solve the issue)

Disable submit button in Google Forms?

I'm writing a form and have a multi-select with certain responses (age range); for ranges below a specified value, we redirect users to a page with information on why we don't accept that range currently, etc.
The problem is that the form navigation appears on this page, so they can hit Back (no problem) and Submit (problem).
We don't want users submitting if they wind up on this error-catch page, but I haven't seen any way of disabling or hiding the submit button.
Even checking Google scripts, it doesn't seem like this is possible? Does anyone know if there's a way to do this?
The SUBMIT button either appears on the last page, or on pages where the setting is set to: Submit Form
You probably have the error page as the last page, and the next to last page set to Submit Form.
There is no way to disable the submit button. Put the error page BEFORE the last page. Make the page that is right before the error page skip over the error page and navigate to the last page (Submit Page). On the last page have only one question like: Are you done? "Yes" "No" This way, the user will never see the submit button until they get to that last page. On the Error page, set the page navigation to go to something like back to the first page. If the user clicks BACK on the SUBMIT page, it will skip over the error page and go to the page before it. Of course, the user could navigate back, and change the answer, and get to the SUBMIT page. But then they'd be lying about their age.
You can disable the Google form by accessing Responses tab and unchecking the option Acception responses.
you can use this restrict Data in Google Sheets with Data Validationso it will show a pop up message based on DATA
https://www.howtogeek.com/428919/how-to-restrict-data-input-in-google-sheets-with-data-validation/

Access 2007 Split form VBA: acNewRec on open prevents tabbing through form - acts like the first field is not 'selected'

I hope someone can help me out, or at least help figure out a workaround.
I'm using Access 2007's split form feature, and have the code below run on the Form_Open event, as well as after two button_click events. The code works fine when run after the button_click events, but when it runs on the form_open event, it causes problems.
If form is opened and user enters text in the first field, he/she cannot use Tab or mouse to select the next form field. The user is stuck on the first form field until pressing Esc to cancel the data entry. In order to successfully enter data in the first form field when the form is opened, a user must first select another form field, then re-select the first form field then enter text in first form field. After this nonsense, the user CAN select next form field with Tab or mouse. This must be performed once every time the form is launched. The same VBA code on the button_click events works fine.
Noteworthy: When the form is first opened, NONE of the form fields in the datasheet section of the form appear 'Selected'. When a user begins to enter data in the first form field, the 'new record' marker (*) moves to the second row as it should, but the first row does not show the data being input. This behavior is odd.
After performing the clear field, click another field, click back to first field workaround described above, the datasheet shows properly selected fields and Data as it is input.
Any ideas? Is this a bug? Is there an easy workaround, such as performing the field-select workaround via VBA at form open?
Any help is MUCH appreciated.
Code:
DoCmd.ApplyFilter , "([Contractor].[CheckOutStamp] Is Null)"
DoCmd.GoToRecord , "", acNewRec
Link to mdb:
https://docs.google.com/leaf?id=0B-jx09cwIQDsYWM2MzMzMDQtYjUzNi00N2E5LWFjYTktNzFiYWYzMDZiYWU1&hl=en&authkey=CPPmoMEF
Some thoughts:
Try moving it from OnOpen to OnLoad. The events in OnOpen can happen before the data is actually loaded, where as OnLoad happens after that is already done.
Also, you might want to just set the form's Filter property to [Contractor].[CheckOutStamp] Is Null and set the FilterOn to Yes, and set the form to DataEntry, which means it defaults to a new record upon open, and doesn't load any of the older records. Once it's open, you can change the form's edit/add mode to whatever you like.