connecting excel to a database

  • Thread starter Thread starter bhanu
  • Start date Start date
B

bhanu

how to prepare a form in excel so that it gets saved in the database
and we can fill it and send it to the database. and we can retrieve it
for future reference?
 
how to prepare a form in excel so that it gets saved in the database
and we can fill it and send it to the database. and we can retrieve it
for future reference?

You make a field of tyoe OLE in a table. Make a form with this field.

Properties should be:
OLEType-Embedded
Sizemode Clip
DisplayType Icon
-Of course here you can play a little!

Make a button with this code:

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

With Me!OLE
.Enabled = True
.Locked = False
.Verb = acOLEVerbOpen
.Class = "Excel.Sheet"
.Action = acOLECreateEmbed
.Action = acOLEActivate
End With

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
Where OLE is the name of the control in your form.

-To make a new sheet - click the button
-To open an existing one doubleclikk the control

Sincerely

Hans Kristian Eide
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top