fabulist8
asked on
VB 6.0 "Compile error: Argument not optional" simle solution?
i am new to VB 6.0, so this hopefully is a quick fix. i keep getting "Compile error: Argument not optional" as an error when i try to run my code:
Private Sub Command1_Click(Index As Integer)
glname = frmAddNew1.lname
frmAddNew2.Show
Unload frmAddNew1
End Sub
1. ".lname" is highlighted. i have no idea why.
2. If i run this instead, everything works:
Private Sub Command1_Click(Index As Integer)
glname = "This is a string"
frmAddNew2.Show
Unload frmAddNew1
End Sub
all i want to do is set glname to the .Text value in the textbox 'lname'. how do i do this?
thanks!
Private Sub Command1_Click(Index As Integer)
glname = frmAddNew1.lname
frmAddNew2.Show
Unload frmAddNew1
End Sub
1. ".lname" is highlighted. i have no idea why.
2. If i run this instead, everything works:
Private Sub Command1_Click(Index As Integer)
glname = "This is a string"
frmAddNew2.Show
Unload frmAddNew1
End Sub
all i want to do is set glname to the .Text value in the textbox 'lname'. how do i do this?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
was it my spelling?
what is lname? a textbox or label
or an array of textboxes or labels??? then it would be something like
frmAddNew1.lname(0) or frmAddNew1.lname(1) depending on the cpation or text you want to capture