Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access/Excel with VB question

Status
Not open for further replies.

tk7834

Programmer
Jul 9, 2002
15
US
I'm writing a program to allow a user to query by certain criteria and display all applicable records (about 5 fields per record). Once displayed, 1 of the 5 fields should be able to be updated where the other 4 are read-only.

My problem is how to display the results and still be able to update the one field. I thought of either an Access table or an Excel spreadsheet.

Any good thoughts or ideas? I'm also not sure how I can get either a table or spreadsheet to display. If anyone's been there/done that or have any bright ideas, I'd love to hear them. Thanks!!
 
hi,

try DBGRID which come with VB. it's a great tool to display and Add/Update/Delete data from your table.

hope this helps else write back...

[cheers]
Niraj [noevil]
 
actually, I'm not familar with DBGRID, so if you could expand a little more I'd appreciate it. Thanks Niraj!!

Tony
 
ok,

Firstly goto Projects->Components and select "Microsoft Databound Grid Control"

As this is a bound control u need a datacontrol. So put a datacontrol and the DBGrid on the form.

Connect the Datacontrol to yor database. Set the properties like "Connect" , "DataBaseName" etc...

Set the DBgrid's "DataSource" to the DataControl u just placed.

Set the Datacontrols' Recordset property at run time ->
DataControl.RecordSource = "select * from abc"

and run the app. the results are displayed in the grid.

Set the AllowAdd , AllowUpdate , AllowDelete properties of the DBGrid to True or False according to ur requirement..

U will need to have "DBGRID32.ocx" installed on your machine.
If not mail me at kniraj@hotmail.com and will send u the same.

Hope this helps else.... mail me for a sample project

[cheers]
Niraj [noevil]
 
UFO - Thanks for taking the time to help!

I tried your steps, but didn't get very far. My "Microsoft Databound Grid Control" onlys says 5.0. I choose that, but then when I attempt to add a DBGRID, I get a message saying that my Liscense Information for this component is not found. Maybe I just don't have that feature installed, I'm not sure. Do you think a MS Access table is not good? I don't know much about what you're talking about, so I'm just curious about a diffeent route to take...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top