Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: Trying to populate form fields posted on intranet from a dat
Hi all,
I have designed a userform in excel and this form is posted on companys local intranet site so others can user it to feed in their info, Now, My question is: Is it possible to populate certain fields on the form from a Database? For eg, they input their ID in the form and their other details like their name, division etc populates automatically from the database. Is it possible to do this with access database? the form is on the companys local intranet and the access database would be on some network drive or where ever the form can pull the information from. Can this be done? Thanks in Advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: Trying to populate form fields posted on intranet from a dat
First Create a reference to Active X Data object Library 2.7 via
Tools--references--Microsoft Active X Data Objects Library 2.7 And Then somthing like the following if you need help post back. Sub DatabaseQuery() Dim ConnectionString As String Dim Recordset As ADODB.Recordset Dim SQL As String 'Connection.udl is the best way to get your 'connection string. Open "Notepad" and save as '"Connection.udl" Then walk through the steps ConnectionString = "" 'You can use Access' Query builder for the 'SQL Statement you need SQL = "SELECT * FROM tblYourTable" Set Recordset = New ADODB.Recordset Call Recordset.Open(SQL, ConnectionString, adOpenKeyset, adLockReadOnly, adCmdText) If Not Recordset.EOF Then With UserForm1 .Textbox1.Value = Recordset.Fields(0) End With End If End Sub "sam" wrote: Hi all, I have designed a userform in excel and this form is posted on companys local intranet site so others can user it to feed in their info, Now, My question is: Is it possible to populate certain fields on the form from a Database? For eg, they input their ID in the form and their other details like their name, division etc populates automatically from the database. Is it possible to do this with access database? the form is on the companys local intranet and the access database would be on some network drive or where ever the form can pull the information from. Can this be done? Thanks in Advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trying to populate form fields posted on intranet from a dat
Sure, it can be done if you have authority to access the data base, you know
where the data resides on the data base and you know how to write the code to return the data from Access to Excel. "sam" wrote in message ... Hi all, I have designed a userform in excel and this form is posted on companys local intranet site so others can user it to feed in their info, Now, My question is: Is it possible to populate certain fields on the form from a Database? For eg, they input their ID in the form and their other details like their name, division etc populates automatically from the database. Is it possible to do this with access database? the form is on the companys local intranet and the access database would be on some network drive or where ever the form can pull the information from. Can this be done? Thanks in Advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populate Fields | Excel Discussion (Misc queries) | |||
populate the fields | Excel Programming | |||
VBA Form problem over an Intranet | Excel Programming | |||
Can VBA process messages posted to its main form? | Excel Programming | |||
Populate fields From excel file to Web form/objects | Excel Programming |