Solved

Visual Basic -- MSFlexGrid

Posted on 2004-08-30
5
533 Views
Last Modified: 2012-05-05
Hi,
I'm using MSFlexGrid to display my MS Access table on the screen.
Previously I have only 5 columns. I have added one more column [Status] but having the run time error when I execute the program.
"[Microsoft][ODBC MS Access Driver] Circular reference caused by alias "status" in query defination 's SELECT list."

And here is my code:-

With cmd_daily
    .ActiveConnection = conn
    .CommandText = "select TranDate as [Rework Date],Section as Location,modelno as [Model],serialno as [Serial Number],wo as [Remarks], Status as [Status] from serial_tracking_tbl where format(trandate,'short date') = ?" & " order by trandate desc"
    .CommandType = adCmdText
Set dateParam = .CreateParameter("date", adDate, adParamInput)
    .Parameters.Append dateParam
    dateParam.Value = Format(txtdate.Text, "short date")
   
Set rs_daily = .Execute()
End With

With DailyFlx
    .Clear
    .Cols = 6
    .ColWidth(0) = 2000
    .ColWidth(1) = 2800
    .ColWidth(2) = 2000
    .ColWidth(3) = 2100
    .ColWidth(4) = 3200
    .ColWidth(5) = 1000
End With


Anyone can help?

THanks
HCLim
0
Comment
Question by:hclim
5 Comments
 
LVL 6

Expert Comment

by:cwkhang
ID: 11932017
mayb caused by Status as [Status]
try not using the 'status' as alias

gd luck
0
 

Author Comment

by:hclim
ID: 11937595
I have tried before to change "status" to other name, but still failed.
I believe someting to do with the query in order to add additional column.
Thanks & Regards
HCLim
0
 
LVL 5

Expert Comment

by:rsriprac
ID: 11937824
Could you try:

[Status] as [Status]

instead of:

Status as [Status]

-Ram
0
 
LVL 5

Expert Comment

by:rsriprac
ID: 11937836
'status' is possibly a resurve word, so its having issues I think.  if the about don;t work try:

[Status] as [Foo Bar]

And see if that works, if so, its a compound problem of both recursive reference and reserve words.

-Ram
0
 
LVL 3

Accepted Solution

by:
Stimphy earned 50 total points
ID: 11938530
If that dont work try this

   .CommandText = "select TranDate as [Rework Date],Section as Location,modelno as [Model],serialno as [Serial Number],wo as [Remarks], serial_tracking_tbl.Status as [TheStatus] from serial_tracking_tbl where format(trandate,'short date') = ?" & " order by trandate desc"

Regaurds,
Dave
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapBully challenge 6 127
egit plugin on eclipse 8 62
Filename to be appended with DateTimeof Download 3 55
Removing line numbers from left column in config file 7 51
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
A short article about a problem I had getting the GPS LocationListener working.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question