|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi, my name hanafiah
i like to ask one question to the developer that using vb as a develoment tools. i want to use treeview as my menu which as take all the details for the treeview from the database include the form name. but a having a problem when i want to show that particular form using the command form.show because it not supported, can any one help me on this matter.. thank you |
|
#2
|
||||
|
||||
|
Welcome to the Dev Shed community.
I'm not really sure I understand your problem(s) can you please explain better? Please show where you are having the problem along with what errors you are getting. Also, I would suggest that you follow the link in the sticky thread at the top of this forum and read the "How to Post a Question" thread. It will give you some good details on how to post a proper subject title. |
|
#3
|
|||
|
|||
|
Hi, i'm sorry for my last question, acuatlly what i try to are :
1. inside vb when we create form, we can use menu editor to create the menu. but i find if i use this menu editor my menu fix, which mean i must hard code all the menu name into the form if i want to disable or enable it. so i try to use the treeview where i store all the needed info in the table, espacilly formname. i can retrieve the menu name but when i want to display the form i cant because it give error : "Object doesn't support this property or method" here is the code that is use: Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) dim myobject as object ' Create an ADODB Recordset object variable. Dim objrec1 As New ADODB.Recordset Set objrec1 = New ADODB.Recordset objrec1.CursorType = adOpenKeyset objrec1.LockType = adLockOptimistic objrec1.Open "select * from Menu where menutext ='" & Node & "' and menuid =" & Val(Node.Key), gldbobjconn, , , adCmdText If objrec1.EOF = False Then Set myobjrec = objrec1!formname myobjrec.Show Else End If End Sub ** purpose i do this method is diffrent user login will have diffrent menu to enter, previously i controll all menu using code so i find its dificult to maintain because user always ask me to add new menu / form |
|
#4
|
||||
|
||||
|
I understand what you are trying to accomplish now, but unsure of a way to accomplish it. This may be possible, but unsure of a method to do it.
|
|
#5
|
|||
|
|||
|
Quote:
I don't think the ! operator is available to VB like it is in Access. Plus I don't understand what you're trying to do with this line. |
|
#6
|
|||
|
|||
|
treeview
actually that line use to set the object to the form name that read from file, and there is an error in the coding, myobject should be declare as form not object.
** actually i want to read the menu from the database (this already done). and when user click the menu system will read form name from database and display its using form.show command but when it going to execute that show command its prompt the error object doesnt support. |
|
#7
|
||||
|
||||
|
Quote:
What he is trying to accomplish in simplified terms is to have a form object that is dynamically set through a string and then activate the form. i.e. Code:
Dim formName As String Dim myForm As Form formName = "Form1" Set myForm = formName myForm.Show But the following is illegal, so I am unsure as to how to solve this problem. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > treeview |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|