MSFlexGrid to display Excel data on VBA form

P

poppy

Good day

I have created a workbook that a user can maintain staff leave. I need
help with two thing.

1. I want to be able to restrict to unique records. For example if an
employee with the #87 is created and the user tries to create another
employee with the same #, then the program should inform them that that
# is already in use, so they should try a new #.

2. I have included an MSFlexGrid to one of my forms to display unique
employee data. I want the program to search the sheet to find the
employee # and all the data related to that employee and dislpay it in
the FlexGrid.

The problem is that I don't see a DataSource property for the FlexGrid.
How do I go about displaying this data in the grid?

Thanks for all your help

Kind Regards
 
P

poppy

Good Day All

Previuosly I had the following request:
1. I want to be able to restrict to unique records. For example if an
employee with the #87 is created and the user tries to create another
employee with the same #, then the program should inform them that that
# is already in use, so they should try a new #.

I have managed to do this thru trail and error.

2. I have included an MSFlexGrid to one of my forms to display unique
employee data. I want the program to search the sheet to find the
employee # and all the data related to that employee and dislpay it in
the FlexGrid.

I have been able to display data from a sheet in the Grid, however, I
haven't

The problem is that I don't see a DataSource property for the FlexGrid.
How do I go about displaying this data in the grid?
 
P

poppy

poppy said:
Good Day All

Previuosly I had the following request:
1. I want to be able to restrict to unique records. For example if a
employee with the #87 is created and the user tries to create anothe
employee with the same #, then the program should inform them that tha
# is already in use, so they should try a new #.

I have managed to do this thru trail and error.

2. I have included an MSFlexGrid to one of my forms to display uniqu
employee data. I want the program to search the sheet to find th
employee # and all the data related to that employee and dislpay it i
the FlexGrid.

I have been able to display data from a sheet in the Grid, however,
haven't

The problem is that I don't see a DataSource property for the FlexGrid
How do I go about displaying this data in the grid?

I'm sorry I couldn't finish my post. I was called away. I have bee
able to display the data in the sheet in the grid. I used the followin
query:

Code
-------------------

MyMainRecordset.Open "Select * from [Sheet1$] ", MyConnection, adOpenStatic, adLockOptimistic

-------------------


I however want ot be able to display only data related to a particula
employee. I want the user to enter in an employee num and this numbe
will be used like this:


Code
-------------------


MyMainRecordset.Open "Select * from [Sheet1$] where Persal_Number =""55""", MyConnection, adOpenStatic, adLockOptimistic

-------------------


Where the Persal_Number is a defined range.

Any help would be appreciated.

Thanks and Kind Regard
 

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

Top