Webform within Access Form - ms-access-2007

I am trying to incorporate a html menu within access form. How would I get the feedback (on what the user selected within the web page) from the webpage into Access. I am using Access 2007, MS WebBrowser component.
any help would be appreciated

There is no official way to call the hosting form or initiate any activity on Access from within the WebBrowser.
However, there is one nifty trick which I use. After the document is loaded you can setAttribute of some element to the Access form. htmlDoc.all.formDiv.setAttribute "outerForm", Me
Then you can reference properties and methods of the form from within the WebBrowser.
document.all.formDiv.outerForm.Application.DoCmd.Close(2,"webForm")
EDIT:
Oddly, it seems that the reference remains null when as I add the <META http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> tag. Seemingly, the properties are more strict now, and setAttribute is expecting a string.
The next option is to pass the Access Form ('Me') to a variable in the WebBrowser. However it doesn't look like the global variables or functions are directly exposed.
This, though, can easily be overcome by adding a function to the prototype of HTMLBodyElement which passes its argument to a global variable, and can return any class as well.
In the html page you'd have this:
var frm = null;
HTMLBodyElement.prototype.setForm = function(f){frm = f}
From Access simply pass the reference down: htmlDoc.document.body.setForm(Me).

Related

Concrete5 hardcode External Form to template

I have managed to create an external form using the method: http://www.concrete5.org/community/forums/usage/external-form-email... The form worked when I embedded the block via cms. However, I need to put the form into my template. the following code did not work.
$b = Block::getByName('My Form');
$b->display();
It it probably because my external form did not have a block name. But how could I set its name?
Block names can only be set when the block is placed on a page (which means you're in a catch-22 here and have no way to achieve that).
Instead of attempting to output this block directly, try putting it in a global area in your template instead. You can then tell the global area to not show editing controls or the red dotted outline by disabling them. See http://concrete5tricks.com/blog/dont-hardcode-blocks-use-a-global-area-instead/
btw, you might be interested in this code I have which makes custom contact forms much easier and better than the built-in "external forms" block (in my humble opinion): https://github.com/jordanlev/c5_custom_contact_form

SharePoint: SPField.FieldRenderingControl does not render if the list is from another site

I have a custom New/Edit form that renders the edit controls using the FieldRendering control property of the fields. When the list and form are at the first level subsite (RootSite/SubSite1) of a SharePoint site collection. It works just fine.
When I try to use the same code to render the form in another first level subsite (RootSite/SubSite2) of the site collection, a sibling of the first site, the edit controls do not render. I have the code in (RootSite/Subsite2) and the list is still in (RootSite/SubSite1). I got a hint that RootFolder parameter might help but that did not work out. Any Ideas?
Thanks
I this case you can open the root site as follows:
using (SPSite oSPsite = new SPSite(SPContext.Current.Site.RootWeb.Url))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{

Send data form modal window Sharepoint

i am developing an application over Sharepoint 2010, I am using ECMAScript Client Object Model, so from one applications page using SP.UI.ModalDialog.showModalDialog(options) I am openning another page. From this second page I want to send the information the user inserts back to the parent page. HOw can I do this?.
Thanks a lot for any comments !
You can pass callback function in options of the showModalDialog method. This callback function takes two parameters, a dialogResult and a returnValue of type object that can contains any data.
http://msdn.microsoft.com/en-us/library/ff410058.aspx
When you close your modal dialog with method commonModalDialogClose you can pass result and object parameters and use them in your callback function in the parent window.
http://msdn.microsoft.com/en-us/library/ff409682.aspx

Having codebehind for Custom .aspx page in sandbox solution

I am having working with sandbox solution. i have one .aspx page in my solution and i have placed one button tag in that page, i need to write server side code for that button. But it is showing "The event handler 'OnClick' is not allowed in this page." . Does codebehind is not allowed in sandbox solution. Or indirectly how can i write my c# code for that button.
I know we can do it by creating one webpart and show that webpart in page using "WebPartPages:SPUserCodeWebPart" tag . But i want to confirm whether we can write codebehind for an asp page in some way or not.
Without changing the web.config file (which would not be recommended in this case), inline code or code behind files are not supported outside of the layouts folder (which you cannot deploy to with a sandbox solution).
However, you should be able to create a class and then set the inherits attribute to point to that class, instead of referring to the class in a code behind file.

How to pass a value between Silverlight pages for WP7?

I've got a MainPage.xaml page a Detail.xaml page.
I've passed variables to the Detail.xaml from MainPage.xaml by using a static variable and referencing it in Detail.xaml (the detail page is acting like a dialog). However once I've updated the content of another object, I want to call a method in MainPage.xaml to refresh the content of that page using the updated object from the Detail.xaml page.
I assume I am not using the correct paradigm for this and should probably be using MVVM or something but I'm not familiar with the implementation and was hoping there was a simple way to do this?
Can you load the content from the static into your control in the OnNavigatedTo?
You can make a method in your main page to do that job and call that.