Problem with TableView and SQLName

Questions regarding syntax

Problem with TableView and SQLName

Postby PMan » Sat Jan 29, 2011 3:46 pm

Hi,

I try to use a form with TableView = TRUE and SQLName to show Values of a MySQL-table in a form with a table. I use the tablename or the statement "SELECT * FROM " & tablename to fil the SQLName. In both case I get a error: Error in SQLName = tyblename / SQL-statement

Code: Select all
Private Sub Form_OnOpen()

Dim sSQL as String

  sSQL = "SELECT * FROM " & ho_TBL
  Database.SetCurrentDatabase(ho_DB)
  frm_WorkTable.SQLName = ho_TBL              ' or sSQL

End Sub

ho_DB and ho_TBL are declared as public varables and filled in the calling routine. The database is connected. The table have no kbRecordID.

I don't know, what's going wrong. What must I do, to get the tablevalues in a form with a table?
PMan
 
Posts: 145
Joined: Sat Jul 03, 2010 12:31 pm
Location: Switzerland

Re: Problem with TableView and SQLName

Postby berndnoetscher » Mon Jan 31, 2011 7:19 am

PMan wrote:Hi,

I try to use a form with TableView = TRUE and SQLName to show Values of a MySQL-table in a form with a table. I use the tablename or the statement "SELECT * FROM " & tablename to fil the SQLName. In both case I get a error: Error in SQLName = tyblename / SQL-statement

Code: Select all
Private Sub Form_OnOpen()

Dim sSQL as String

  sSQL = "SELECT * FROM " & ho_TBL
  Database.SetCurrentDatabase(ho_DB)
  frm_WorkTable.SQLName = ho_TBL              ' or sSQL

End Sub

ho_DB and ho_TBL are declared as public varables and filled in the calling routine. The database is connected. The table have no kbRecordID.

I don't know, what's going wrong. What must I do, to get the tablevalues in a form with a table?


I think, kbRecordID is needed for the tableview mode of an form. This will change in the new version.
berndnoetscher
Site Admin
 
Posts: 1059
Joined: Tue Sep 25, 2007 9:37 am

Re: Problem with TableView and SQLName

Postby PMan » Mon Jan 31, 2011 10:27 am

Hi Bernd,

is there an other posibility to build a grid or a table in a form? What control can I use for this?

/PMan
PMan
 
Posts: 145
Joined: Sat Jul 03, 2010 12:31 pm
Location: Switzerland

Re: Problem with TableView and SQLName

Postby Henning » Mon Jan 31, 2011 11:54 am

You could try using a ListView control.

/Henning
Henning
 
Posts: 262
Joined: Mon Feb 09, 2009 12:03 am
Location: Sweden


Return to Coding Questions

cron