List Box Not Populating - vba

I have a multipage user form and when I load the form with Developer Visual basic and run it performs as it is supposed to.
However, when I run it from the button, I created to go to a dashboard first and then another button to jump to one of the multiages the list box does not populate the data.
Here is the code for the button on the spreadsheet to go to dashboard
Private Sub cmdBtnNewRecipe_Click()
Load NewRecipe_UF: NewRecipe_UF.MultiPage1.Value = 0: NewRecipe_UF.Show
End Sub
if i load the page from the actual data sheet then the dashboard works fine but i want to go to the dashboard on page1 of the multipage first.
This Works:
Private Sub cmdBtnRecipeInformation_Click()
Load NewRecipe_UF: NewRecipe_UF.MultiPage1.Value = 1: NewRecipe_UF.Show
End Sub
Anything i can do to make this work. hope i explained enough information.
Thank you
I am not sure what to try here. The dashboard works when i go through developer visual basic and run so its strange from the button click on the spreadsheet which goes to the dashboard to the button that goes to page1 of the multipage form the list box does not populate data. I am able to navigate all the pages and i am getting where i want to go.

Related

Endless form not showing after filter applied previously

I am using unbound endless forms to display data from my database.
The data source is set to queries which provide data to show on the form.
All tinkering with the data itself on the form is blocked (entry, adding, deleting, etc.).
The data on the form can, however, be filtered through Access' standard ways (right clicking on the data and selecting the options or through the navigation buttons down the bottom of the form).
I am using another unbound form as a menu. Buttons on the form let the user open the data display forms. The buttons are connected to the forms through an on- click event that triggers a DoCmd.OpenForm ("frmOutput") line of code to display the form.
Recently I've had users report, that opening the endless data display forms from the menu, filtering data on the form and then closing the form without taking the filter out has resulted in the form not being able to be opened again from the menu (clicking the respective button results in no action whatsoever). The bug seems to even save to the application somehow and moving the (frontend) file to another machine still shows the same error of not showing the form.
It seems that the bug appears more often when people use multiple screens, and use the application on their second screen (as per their Windows settings).
Does anybody know what causes the bug or how it can be prevented?
Any pointer in the right direction is much appreciated since I am at a loss where to even start looking for the culprit!
Hard to tell but it sounds like their filter is being saved when form is closed
If you already have an event that opens the form, try to just clear the filter property after it opens. You can do this from all your command buttons by just changing the form name that gets passed to it
Private Sub OpenUnfilteredForm(strFormName as String)
Dim frm As Form
DoCmd.OpenForm (strFormName)
DoEvents
If CurrentProject.AllForms(strFormName).IsLoaded Then
Set frm = Forms(strFormName)
With frm
.Filter = ""
.FilterOn = False
End With
End If
Set frm = Nothing
End Sub

How can I refresh the data on my access Front End?

I built an access Form frontend with a sharepoint list called "teammates" as the back end.
The form is simple, consists of two listboxes that lists all teammates, one box is for absent teammates, the other is for present teammates. I have some buttons and methods that allow to update a teammates status, thus moving them into either the "absent" list box or the "present" box.
I also have a "Refresh" button on the page.
Private Sub btnRefreshForm_Click()
DoCmd.RunCommand acCmdRefreshSharePointList
CurrentDb.TableDefs("teammates").RefreshLink
Me.lsbAbsentTeammates.Requery
Me.lsbPresentTeammates.Requery
Me.Requery
Me.Refresh
End Sub
My issue is this, when I share the FrontEnd with someone else, that person will send some teammates to the absent box, but I cannot see those changes, the Refresh button does not requery the data.
The only way I can see the updated data is if I close the front end and reopen it.
How can I see the updated data without having to close and reopen the application ?

Microsoft Access can't open a form from inside another form with doCmd.OpenForm

I'm completely new to MS Access but not to databases. I have a form that is meant to open another form through a button and users are to add records to a target table through said form. The main menu fails to open my secondary form saying "recordset is not updatable". The table that is to receive the records is editable and I can go into it and manually add records so this doesn't seem to be the problem. If I click out of the error through the error handler menu I'm taken to the form that I expected to open, but it is read only-- I can't see it's properties sheet, design view, or even change the view at all. I looked at the VBA code on the main menu and it does use doCmd.OpenForm "myForm", , , , , ,"New"
Any pointers would be really appreciated.
Right click your form and click design view. Add a button, click Cancel and name the button appropriately. Than, right-click the button and click Build Event > Code Builder > OK. Copy/paste the code below into the button click event.
Private Sub Command0_Click()
DoCmd.OpenForm "name_of_your_form"
End Sub
That should be all you need to do. Sometimes I have seen Access do some really weird stuff. If the steps I outlined here don't work, try doing a Compact and Repair to reset everything in your DB, and then add the button.

VB.NET - Navigating without loading another form

I'm currently developing a simple enrollment system for our school project. I have multiple modules that when clicked will open a new form with another set of sub modules.
However, I hate how forms load every time I open a new form. Is there like a way that when I clicked say for example "Enrollment" button, instead of loading a new form, it will change all the controls instead. Tried using User Control but it keeps crashing my program down after I created 2 user controls and load them in one form.
Main Form;
Enrollment Sub Form
Please help me guys.
As LarsTech mentioned I would use user controls instead of forms.
Each user control would be setup the same way as your form is, but can be loaded to a panel on the main form, allowing for a single form to show all content.
Dim myControl = New ControlYouCreated
panel1.Controls.Add(myControl)
myControl.bringtofront
This for example, will bring in the contents of the user control you created, into your form1 panel.

Loading new form within a navigation tab in ms Access 2010

I have created the following navigation structure in a Microsoft access 2010 database:
You can see that there are two tabs, and the data for the tabs is populated with information linked to the ClientID, which is stored in an un-editable textbox at the top of the form. When the Communications Forms tab is selected, a list of communications forms that have been completed for the specific ClientID is shown. And there is a button to create a new form. My question is how do I write the macro so that clicking on the Create New Form button will cause a blank new form to be loaded in the space that is currently occupied by the List of Forms?
Below is what I have so far. It sends the user to a new form instead of embedding the new form underneath the Communication Forms tab in the current form. How can I change the below so that the blank new form is loaded under the Communication Forms tab in the current form, so that all the navigation controls remain visible/usable?
EDIT:
To address HK1's assumptions below, I am adding the following description of the steps I took to create the form in the screenshot above:
1.) I created a blank form in design view.
2.) I added a listbox to list client fullname and id, and a textbox to filter the listbox.
3.) I added the clientid and fullname textboxes to the form, and set them to change based on
what the user selects from the listbox
4.) I dragged a navigation control onto the form next to the listbox
5.) I dragged a form called "ListOfForms" onto a new tab in the navigation control to create the tab
6.) I added the CreateNewForm command button to the ListOfForms form while embedded in the main form
Here is the result of HK1's suggested code:
While I appreciate it, it does not do what I need. You can see that it just adds an additional row to the list in ListOfForms. Instead, I need the code to place a blank MyForm in the place of MainForm where ListOfForms is currently located. Thus, under the CommunicationsForms tab, all the user would see would be a blank MyForm object, which is a different form than ListOfForms.
When I click on the place where ListOfForms is located in Layout View, I see that it is called NavigationSubForm in the Property Sheet. Thus, NavigationSubForm would swap in MyForm in place of ListOfForms when the user clicks on the Create New Form command button. But if the user clicks on CommunicationForms tab again, ListOfForms would again be placed in NavigationSubForm.
I tried the following:
Private Sub cmdCreateNewForm_Click()
Forms!MainForm!NavigationSubform = MyForm
End Sub
But it generates a Runtime Error '438': Object doesn't support this property or method.
Next, I tried:
Private Sub cmdCreateNewForm_Click()
Forms!MainForm.NavigationSubform.SourceObject = MyForm
End Sub
This causes the NavigationSubForm to go blank, so that ListOfForms disappears. This seems like I am on the correct track, but what do I need to do to get it to put a blank MyForm in the NavigationSubForm instead of just an empty space?
The form you have labeled as "List of Forms" appears to be what's called a continuous form, and I'm guessing it's inside a subform control located on a another form. I'm also guessing that your Create New Form button is probably located on the header section of your continuous form. I'm also making the assumption that your continuous form/subform is bound to an editable recordset/recordsource but there's no way I can tell this by looking at the screenshot.
With these assumptions in place, the code for your Create New Form button would probably be something like this:
Private Sub cmdCreateNewForm_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord, , acNewRec
End Sub
If any of my assumptions above are incorrect than it's likely this code won't work as expected.
Be aware that New Records in continuous forms (and datasheet forms) always appear at the bottom of the list. I'm not aware of any easy way of making them appear anywhere else.