Results 1 to 8 of 8

Thread: Modal Forms?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    121

    Modal Forms?

    HI all,
    Im having problems, on my form when I press a button which links to another pages using
    VB Code:
    1. Form_reg.hide
    2. frmnokia.show

    It says sumthing about linking to a non modal form and wont do it, can someone please help, thanks

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787
    hmm could you post your progect?

    try unloading frmreg rather than hiding it
    Last edited by Pino; Jun 27th, 2004 at 04:33 AM.

  3. #3
    Hyperactive Member
    Join Date
    Mar 2003
    Location
    Greece, Salonica
    Posts
    473
    Hmmm...
    Is there a modal form already showed?
    For example are you doing this?
    VB Code:
    1. Private Sub Form_Load()
    2. frmMain.Show vbModal
    3. End Sub
    4. 'The code bottom of this comment is on frmMain
    5. Private Sub Command1_Click()
    6. Form1.Show 'This will generate an error because frmMain is showed modaly

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    there is nothing in the form load to make it modal, all thats in the form load is this

    VB Code:
    1. Private Sub Form_Load()
    2. ver = version.Text
    3.  
    4. Text3.Text = VolumeSerialNumber("C:\")
    5. linecount = 1
    6. On Error GoTo nolicence
    7. Open "Licence.txt" For Input As #1
    8. Do While Not EOF(1)
    9. Input #1, MyChar
    10. Text5.Text = Text5.Text + MyChar + vbCrLf
    11. linecount = linecount + 1
    12. Loop
    13. Close #1
    14. user = GetTextBoxLine(Text5, 0)
    15. pass = GetTextBoxLine(Text5, 1)
    16. If GenKey(ver + "tejpal" + user) = GetTextBoxLine(Text5, 1) Then
    17. Frame1.Visible = False
    18. frmNokia.Caption = frmNokia.Caption + " <" + user + ">"
    19. Frame3.Visible = True
    20. Label2.Caption = "Welcome " + user
    21. Exit Sub
    22. End If
    23. Exit Sub
    24. nolicence:
    25. MsgBox "Invalid key.", vbInformation, "Invalid Username/Password"
    26. End Sub


    And whats in the button is

    VB Code:
    1. Private Sub Command1_Click()
    2. Unload (Form_Reg)
    3. frmnokia.show
    4. End Sub
    I dont understand the problem, please help

  5. #5
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    It doesn't matter what is in the form load as that has nowt to do with showing the form.
    VB Code:
    1. Dim frmNew As frmMain
    2.    Set frmNew = New frmMain 'Forms initialise event fires
    3.    Load frmNew 'Forms load event fires
    4.    frmNew.Show vbModal 'Activate event fires
    5.    Set frmNew = nothing
    Woof

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    whats that code?

  7. #7

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    VB Code:
    1. Dim frmNew As frmMain
    2.    Set frmNew = New frmMain 'Forms initialise event fires
    3.    Load frmNew 'Forms load event fires
    4.    frmNew.Show vbModal 'Activate event fires
    5.    Set frmNew = nothing

    Would frmnew become the form its on which is form_reg?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width