MultiPage Form Identify VBA - forms

it might be the silliest question anyone ever asked, but I have been looking for a long time and I could not find an answer.
I have a form with a multipage with 2 pages, and I want to know which page is the one the user is filling up when he presses the ComandButton (which page is the user viewing at that moment). I want that because depends on which page the data will be inserted in diferent place.
If more info is needed, just let me know.
Thanks.

For a control called MultiPage1 you could return the page as below
For example
`1st tab
Me.MultiPage1.Value = 0
`3rd tab
Me.MultiPage1.Value = 2

Related

Databinding during Navigation in UWP

I'm using Windows Template Studio to create a simple UWP app. I'm using the built-in MVVM template for Multiple Pages.
I have 2 Pages on the app. Both the pages contain the few textboxes where the user can enter some values. Data binding is working perfectly on both the pages individually. My problem is:
When I navigate to Page 2 and return back on Page 1, the value in the Textboxes return to the original initialization values and do not remain the last updated values.
I am expecting that when I return to Page 1 from Page 2, the values on Page 1 should be the last updated values.
I've followed a lot of tutorials but could not find a comprehensive solution to it.
I am just getting started with UWP and MVVM so it may be hard for me to wrap my head around some of the basic concepts.
Any help in this regard is appreciated.
You need to think about saving these TextBox values in the ApplicationData. For example, the ApplicationData.LocalSettings.
When you navigate from page1 to page2, you could save the value in localSettings.
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
localSettings.Values["exampleSetting"] = "Hello Windows";
When you get back from page2 to page1. You could get the value from LocalSettings.
Object value = localSettings.Values["exampleSetting"];
Please see the Application data sample for more details.
Have a look at NavigationCacheMode
https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.page.navigationcachemode
This should allow you to Cache the data you've entered and will persist whilst navigating to different frames

Working with a form in Add mode

please bear with me while I try to explain my problem. I am opening a form in Add mode; the form is bound to a single table but contains a subform linked to another table - the 2 tables have a 1 to many relationship. I enter some data which triggers the autoref to populate on the main form, and create a linked record on the subform. I then click a button on the main form to open another form. Using vba on the OnClick event of this button, I save the record on the current form and create a new record in a different table. This table is the data source for the 2nd form, and I open the form filtered to the newly created record. I enter some data in this secondary form and then click a button which takes a calculated value and populates a field on the main form and then closes the second form. The problem is that when it returns to the main form it seems to have lost the original record, as if it's back in Add mode. However, if I enter data on the main form and then simply close it, I can re-open it (in Edit mode) and open the 2nd form and back again without any problem. Sorry for the long-winded explanation but hope someone can help.
I've been programming Access for almost 20 years, and I've never found a use for Add mode. In other words, it has always been more trouble than it is worth.
Since you are coding already, I would just use DoCmd.GoToRecord , , acNewRec where needed to take you to a new record. Just make sure AllowAdditions is set to Yes in form properties.
Since this question is very general, it is hard to get any more specific than this. But if you do run into a specific problem that you can demonstrate in your code, update your question and I'll take a look.

MS-Access 2007 Form cannot edit data until Form changed to Design View & back to Form View

Update: Manually losing the form and re-opening it also causes editing to be allowed, please see Step 4 below and "Additional Notes" section below. Thanks!
An MS-Access 2007 database that I have simplified a great deal during troubleshooting still has the same problem:
Restart Access and open the database
The autoexec calls a vba function that initializes some TempVars, then opens a form with: `DoCmd.OpenForm FormName:="MainEditor"
All Bound and Un-Bound Text Boxes and Combo Boxes display their data
correctly, but NONE of them can be edited. Keystrokes are ignored, pull-downs on Combo Boxes display lists of choices correctly but no choice can be selected.
Change the form's view to Design View, then immediately change it back to Form View. Alternatively, manually close the Form and then re-open it.
All the controls continue to display their data correctly, but now ALL of
them can be edited normally.
After changing to Design View and back to Form View, the Form is editable normally until Access is shut down and restarted.
Additional Notes:
I tried adding a DoCmd.Close and a DoCmd.FormOpen immediately after the original DoCmd.FormOpen in the startup function called by the Autoexec macro, but the Form remained unable to accept edits. Manually closing the form, and then manually re-opening it, seems to work every time. Is there any chance that Access needs a delay to process before opening the form, and manually doing the close/open cycle provides that time window?
Here's some background:
The Table has a primary index, 4 other indexes, and one-to-many relations to 7 other tables.
The Form's Record Source is the Table, and Allow Edits = Yes.
All the controls on the Form are set: Enabled = Yes, and Locked = No.
There are no sub-forms, only the one Form.
This isn't much to go on. If you ask for further specifics I'd be glad to provide them.
Thank you. Dave
Instead of using an Autoexec macro, specify a startup form.

Get previous page in UIWebView hierarchy

I need to be able to figure out what is the previous page in a UIWebView hierarchy so that I can disable the back button on certain instances. So, to clarify:
User is on page A - clicks on link
User is now on page B - clicks on link
User is now on page C - clicks on the **back** button
User is now on page B
I need to be able to know that "previous" page from page B is page A. The method I'm using right now unfortunately only figures out the previous page the user was in in general. So in the situation above, it thinks the previous navigated page is page C.
Any help would be appreciated! :)
Each time the user clicks on a link and a new page loads, your web view delegate gets a message. So "write down" that information each time! Now you know what "back" means.
Also, you can talk JavaScript to the UIWebView. JavaScript gives you a history object. A lot of the key functionality in UIWebView is through JavaScript! Apple hasn't bothered to duplicate it in Objective-C properties, because, well, why bother?
years later....
In researching this same scenario, I came up with a nice solution.
Inside webViewDidFinishLoad, check for the property "canGoBack" and hide or unhide your back button accordingly. Thought this was too cool not to share. :)
if (self.webView.canGoBack)
{
self.backButton.hidden = NO;
}
else
{
self.backButton.hidden = YES;
}

bada - Tab bar control

I am new to bada programming and I am facing some problems. I am currently creating an app that consists of 6 tab bar item, each of which have a different form and have different controls in each form. I have tried following the example on http://www.badadev.com/forms-management-in-bada-part-3-managing-forms/ , however, I have set up all the controls in the form, but it does not respond and does not AppLog when I clicked on the button. Can someone please help me on this???
It is very hard to solve your problem that way(without seeing your code). Take look on a XmlParserApp example. It is using FormMgr and maybe you can get some good ideas. Or it is important that you have base class tabsForm that all the forms inherit?