How to fill webpage (Google) values using excel VBA - vba

I'm trying to fill Google account registration form values using excel vba. I'm getting errors while filling below fields. Kindly advise.
Webpage Link - (Google Registration Page)
https://accounts.google.com/SignUp?service=mail&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F&ltmpl=default
1) Month Combobox
2) Gender Combobox
The code that I'm using to fill above fields is
wb.Document.GetElementById("HiddenBirthMonth").Value = 1
wb.Document.GetElementById("HiddenGender").Value = "Male"
Where WB is the object of "WebBrowser"

Taking a look to Google's form page code you can notice both fields are dropdowns.
To customize the dropdown Google used a workaround making both Gender and BirthMonth hidden fields and giving them these ids:
HiddenBirthMonth
HiddenGender

You can use the send key to put the information or select options.
But while using send keys you should loose the focus from webpage.
Ti use send keys code first do manually and identify the sequence.

Related

Passing ListBox values to a report

I'm trying to send off selected values from a ListBox on a form to a report via parameter passing in a URL. As of right now, I don't have access to the report itself to edit right now. Reading up on SSRS parameters passing through URLs, it is stated to just declare the variable multiple times, but trying that doesn't get me anywhere.
What I want for the end result is the user to choose the values from a form, click a button and have the report open in a new browser window. Up until now I can deal with different datatypes, but the listboxes are something I have never encountered before and can't find much information about.
My current logic for this is to loop through the listbox selections, and keep the values stored until I generate the url. When the window is opened, I want only the selected values from the listbox on my form to be the only values selected in the SSRS report. Any help would be appreciated!
Check if you need multi select or not
ListBox1.SelectionMode = SelectionMode.MultiExtended
ListBox1.Items.Add("1")
ListBox1.Items.Add("2")
ListBox1.Items.Add("3")
ListBox1.Items.Add("4")
get the selection from the list box like this
For Each xSelection As String In ListBox1.SelectedItems
MsgBox(xSelection)
Next

Populating Fields in InfoPath using the People Picker

I've got an InfoPath form and have set up a Data Connection to enable me to retrieve details of a persons account using the people picker.
I've got the First Name/Last Name/Department and Job Title. When I open up the People Picker the only fields I'm getting are Display Name/AccountId and Account Type (as pictured).
Is there a way of getting the information I want?
You can try to get it with the UserProfile webservice of sharepoint. (_vti_bin/UserProfileService.asmx)
f.e:
https://blogs.technet.microsoft.com/anneste/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010/
For anyone still looking for an answer to this:
Unfortunately the UserProfile webservice no longer works in Sharepoint online and produces error 5566.
The best work around for this I've found would be to use a data connection to the hidden User Information List on the root of your page.
So step-by-step:
Add a new data connection for User Information List at the stem of your site
Select the needed fields (in your case First_name, Last_name, Department and Title)
Leave "Store a copy of the data in the form template" unchecked and click "Next >"
Uncheck "Automatically retrieve data when form is opened" to query based on selected users, instead of downloading all user data
Create Rule on change (no condition) on your First and Last Name fields and run the following actions in them:
Set a field's value for first and last name:
in "Field" select queryFields First_name/Last_name of your data connection
in "Value" select your first/last name field
Query using a data connection your Sharepoint List data connection or to User Information List data connection to find any user in the members AD group
Set a field's value on your people picker:
in "Field" select the Displayname of your forms people picker (only available in advanced view)
in "Value" select the dataFields > People Picker > Displayname of your data connection
Hope that helps, I'll edit to include pictures soon.
Please let me know if you wanted to set First name, Lastname, Department and Job title based on the people picker, because this would also be possible. Thank you in advance!

How to generate adidional fields inside Yii form

I have:
Table "user"
id, username, password
Table "freedate"
id, user_id, start_date, end_date
Each user can have 1 or more (unlimited) number of "freedate" entries.
Now i have form with 2 text fields (username and password), and 2 date pickers (one for start date and another one for end date).
How can i enable user to inserd aditional datepicker pairs so they can enter as much of "freedate" entires as they need to?
I was wondering about insertind aditional button inside form, that would somehow create aditional fields when pressed, but u have no idea how to do it.
I don't need working example (even tho one would help ofc). What i need i suggestion from your own expirience if you had similar problem.
You can use javascript as noted above. Though that can get tricky to get the new fields associated with the datepicker.
You can also submit after each pair is entered. On returning back to form after save insert a new set of start/end date fields to the end of the form. This way they always have a freedate pair they can enter. (a bit slower overall)
You need javascript to generate these fields on the fly. Or a fixed amount of extra fields could be hidden and shown one by one using javascript as the user clicks the button. You would need to keep track of the number of fields being shown in a javascript var.
You need to write custom javascript in order to do that. It isn't hard, you would need to do something along these lines:
You need to create a button and, when that button gets clicked (onClick event or jquery click() function) you can add the html for your field (<input type=.... /> and so on to your form) and remember to use the correct name for these fields so that they get sent correctly when the user submits the form.

Syntax for SharePoint 2010 BCS URL Action to populate New form

Have seen several posts with solutions for native SharePoint lists, including the very useful SPUtility.js (only for native SharePoint lists). But nothing to pass a value from a BCS list to a new BCS list. The Query string filter will not connect on the New form (no web part to connect it to) and does me no good on the lists page (already have that working).
A "go write custom code for everything" is not a solution for me.
There should be a way to 1) pass the value in the URL (ideal - what's the syntax?) or 2) make some other simple change, perhaps to the select list for the item -- I just can't find it. Have seen quite a few posts with similar questions. The Microsoft documentation is not useful and there are more questions on the "social" topics than answers.
Here's what I have:
I have a BCS list (sends item) tied to a BCS related list (receives item).
I have an action on the related list (ECT) to create a new item. Works fine with no parameters. I get a blank new form. The new form allows me to enter two items and choose two items (exactly as intended).
What I would like to have is the necessary ?something=something string so that my user does not have to select one of the choice items (MNumber - set as a key / required value)
User selects "New" from Actions.
Form Opens
MNumber is automatically filled in based on the MNumber of the current item displayed in the BCS related list.
The string I supply is accepted. Does nothing.
/intake/Lists/ContactsList/NewForm.aspx
/intake/Lists/ContactsList/NewForm.aspx?MNumber=1234
The string I supply is rejected - cannot be saved or insufficient values.
/intake/Lists/ContactsList/NewForm.aspx?MHICNumber={$MHICNumber}
Have also tried passing a string to one of the text fields (instead of the select field). Can't get that to work either. I've spent quite a few hours with the various boards. Nothing helpful.
Would also be nicer if I could set the New form to display in a pop-over window (as it does when I select New from the list view). Opening a new browser window is hokey and replacing the existing one is a navigation pain for the user.
Have this working ... Thanks to Kit Menke!
Created an Action on the External Content Type in the BCS....
/intake/Lists/ContactsList/NewForm.aspx?IDnumber={0}&Source=/intake/scheduling.aspx
where
parameter property 0 is the IDNumber from the ECT
The NewForm.aspx was edited to add a hidden content editor web part with references to three scripts Kit wrote - two supporting and one that sets the values.
http://site/list/NewForm.aspx?toolpaneview=2
User selects the Action on the displayed ECT list
Action uses the URL to go to the New page with the data
Kit's script adds the data to the form and puts in the date and time.
Note: The ID field needs to be a text field. Cannot be a selection list.

VB in Access: Combo Box Values are not visible in form view but are visible through Debug.Print

Code in Form onLoad:
country_combo.RowSourceType = "Value List"
Code in a reset function:
Dim lListIndex As Long
With Me.country_combo
For lListIndex = .ListCount - 1 To 0 Step -1
.RemoveItem (lListIndex)
Next lListIndex<br/>
End With
Code to populate country combo:
*For n = 1 To numCountries*
*countryCombo.AddItem (countryRS.Fields("countryName"))*
*countryRS.MoveNext*
*Next n*
I'm having a problem that occurs AFTER the code to populate the country combobox runs. The values are there as I can run Debug.Print(countryCombo.Value) and it prints out the name of the selected country, but I can't see the values in the combobox at all. They're invisible, and as far as I know there is no visiblity property for specific items, unless I'm completely mistaken.
comboBoxError.png http://img110.imageshack.us/my.php?image=comboboxerror.png
I think you should probably use Access's GUI tools to do what you're looking for. In design mode, click on the field you are trying to populate, then click the "lookup" tab. You can then specify a table to populate the field with and your forms should automaticly update as well.
I've also seen what you describe here - as far as I can tell, it's a bug within Access (I was using 2007) that only occurs when you programatically mess with the contents of a combo box. It does not happen every time. The issue corrects itself if you highlight the text that is in the combo box.
I am experiencing a similar issue with Access 2003. Based on the selection of one combo box, the row source of a listbox is set to an SQL string Basically a SELECT DISTINCT [MyField_Selected] FROM MyTable. For some fields the values are visible in the list box and others it is not. The values are there however as I can access them via code. To make it more interesting it works fine in Access 2007.
Just found the resolution on another forum. Check the format property of the field(s) in question on the table. In my case, when Access 2007 created the table, it put an # format in there. I removed that and all works great!