I attach a file what was send by Shaik Akthar. I work with it a new
access file. He use Table, I use querie. But it not work.I modify some
code like:
MSFlexGrid.FormatString = "<DATENOW|<NAME|<DIAGNOSIS|<REMARKS"
MSFlexGrid.FormatString = "<Student ID|<Student Name|<Jamal|<Roll No"

Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\DB2.MDB"
Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\student admin.MDB"

rst.Source = "profile2"
rst.Source = "Student"

MSFlexGrid.AddItem Format(rst!DATENOW, "DD/MMM/YYYY") & vbTab & rst!Name & vbTab & rst!DIAGNOSIS & vbTab & rst!REMARKS
MSFlexGrid.AddItem Student ID & vbTab & rst!Student Name & vbTab & rst!Jamal & vbTab & rst!Roll No

It not worked. I don't know what I did wrong. anybody can help me?

if I want to work it with datagrid then what I need to do?

Hi,

Its not vbTab,
Column seperator here is Chr(9)

Regards
Veena

pls check it.

pls check it.

help me with this project.

Hi,

What Part of your Code is Not Working...?
Post your code here..
(dont Attach the project)

Regards
Veena

I just modify thats line what I write above. and others line like attach project.

Dear Taher,

Your entire logic is correct. there is no mistake except for the fieldnames which u r using. they have a space in between. if u need to specify fieldnames which have space then use either of the following ways to denote them.

For field Student Id use
rst.Fields("Student Id")
or
rst![Student Id]

I have modified the project and am uploading it back for ur reference. hope this solves ur problem.

Another suggestion is that try not using the fieldnames with spaces, instead use a underscore to connect if the fieldname is of two words like

u can use "Student_Id" instead of "Student Id"
"Student_Name" instead of "Student Name" and "Roll_No" instead of "Roll No"

Regards
Shaik Akthar

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.