Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Fields soccerhead Excel Discussion (Misc queries) 1 January 11th 08 10:27 PM
populate the fields Mir Khan Excel Programming 0 May 8th 06 11:29 PM
VBA Form problem over an Intranet Gary Excel Programming 1 April 4th 06 02:10 PM
Can VBA process messages posted to its main form? Thivierge.M Excel Programming 0 September 30th 05 09:06 PM
Populate fields From excel file to Web form/objects ilyaskazi[_70_] Excel Programming 1 September 14th 05 06:57 AM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"