Link to home
Start Free TrialLog in
Avatar of hclim
hclim

asked on

Visual Basic -- MSFlexGrid

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
Avatar of cwkhang
cwkhang
Flag of Malaysia image

mayb caused by Status as [Status]
try not using the 'status' as alias

gd luck
Avatar of hclim
hclim

ASKER

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
Could you try:

[Status] as [Status]

instead of:

Status as [Status]

-Ram
'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
ASKER CERTIFIED SOLUTION
Avatar of Stimphy
Stimphy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial