8 Replies - 1623 Views - Last Post: 24 January 2012 - 04:13 PM Rate Topic: -----

#1 zeinzu_kyasuchiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-January 12

error on *mdb loading at VB

Posted 18 January 2012 - 06:47 PM

good day to all.
im having a major problem at starting up a thesis (which we aren't supposed to do yet but our professor forced us to.)
and what i am doing right now is building the program first before starting any document writing. but there was a problem
when i started to load my database in my program it says "user-defined type not defined" im still kinda new to VB that's why im having a hard time coding this. here is the code for that section:

Private Sub Form_Load()
Dim std_db As Database
Password = InputBox("Please Enter your Student Number:", "Log-In")
Set std_db = opendatabase("C:\Users\Tantra playmate\Desktop\std_info.mdb")


thank you.
(i hope i followed the posting rules correctly.)

Is This A Good Question/Topic? 0
  • +

Replies To: error on *mdb loading at VB

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 550
  • View blog
  • Posts: 2,911
  • Joined: 19-May 09

Re: error on *mdb loading at VB

Posted 18 January 2012 - 07:02 PM

That's because some of the objects that you are attempting to use aren't part of VB. You have to tell VB to use them. The way you do that is to go into Tools/References and select a library. In this case the library is DAO, or database access objects. This is where the code for the Database object resides.

I would recommend that you use ADO instead, however, unless your professor "forces" you to use the older technology. :)
Was This Post Helpful? 0
  • +
  • -

#3 zeinzu_kyasuchiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-January 12

Re: error on *mdb loading at VB

Posted 18 January 2012 - 07:11 PM

thanks for the reply.
it was very specific and clear, but i couldn't find any Tools/References. I'll try harder.
Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 550
  • View blog
  • Posts: 2,911
  • Joined: 19-May 09

Re: error on *mdb loading at VB

Posted 18 January 2012 - 07:23 PM

Maybe specific and clear, but dead wrong. Try Project/References and please accept my apologies. :)
Was This Post Helpful? 1
  • +
  • -

#5 zeinzu_kyasuchiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-January 12

Re: error on *mdb loading at VB

Posted 18 January 2012 - 07:32 PM

oh so that's why i cant find it hahaha ;D
ok thanks a lot. this is just the 1st step on my program and there might more stuff that's harder to tackle later on. thanks for the help again. ill post again if I'm stuck on something.
Was This Post Helpful? 0
  • +
  • -

#6 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 550
  • View blog
  • Posts: 2,911
  • Joined: 19-May 09

Re: error on *mdb loading at VB

Posted 18 January 2012 - 11:16 PM

Do that. :)
Was This Post Helpful? 0
  • +
  • -

#7 zeinzu_kyasuchiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-January 12

Re: error on *mdb loading at VB

Posted 23 January 2012 - 10:13 AM

another problem.
the form should load in sequence and choice:
login form loads - after login unloads - opens user interface - click student- open's alpha form and hides user interface.

problem: user interface wont hide and msgbox from log-in pops up.



Private Sub cmdabout_Click()
MsgBox "This project is still under construction and still have room for improvements. this was done by the thesis leader: James C. Castillo, John Erwin de Castro, Julius Dave Castillo, 'add more here xD'"
End Sub

Private Sub cmdlogin_Click()
Dim loginform As New LOG_IN_FORM
Dim userinterface As New USER_INTERFACE
If txtlogin = "04720090491" Then
userinterface.Show
Unload LOG_IN_FORM
Else
MsgBox "An error occured. Please try again.", vbOKOnly, "Organizer System"
End If

End Sub

Private Sub cmdsecretshutdown_Click()
If txtsecretshutdown = "amadacusinsignicus" Then
End
End If
End Sub

Private Sub Form_Load()
MsgBox "Please swipe your ID", vbOKOnly, "Organizer System"
End Sub





Private Sub cmdfaculty_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblfacultyhelp.Visible = True
cmdfaculty.Caption = "CLICK ME!"
lblstdhelp.Visible = False
lblstihelp.Visible = False
cmdstudent.Caption = "Student"
cmdlogout.Caption = "Log Out"
cmdsti.Caption = "STI"
End Sub

Private Sub cmdlogout_Click()

End
End Sub

Private Sub cmdlogout_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdlogout.Caption = "Bood Bye!"
lblstdhelp.Visible = False
lblstihelp.Visible = False
lblfacultyhelp.Visible = False
cmdstudent.Caption = "Student"
cmdsti.Caption = "STI"
cmdfaculty.Caption = "Faculty"
End Sub

Private Sub cmdsti_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblstihelp.Visible = True
cmdsti.Caption = "CLICK ME!"
lblstdhelp.Visible = False
lblfacultyhelp.Visible = False
cmdstudent.Caption = "Student"
cmdlogout.Caption = "Log Out"
cmdfaculty.Caption = "Faculty"
End Sub

Private Sub cmdstudent_Click()
Unload LOG_IN_FORM
Unload USER_INTERFACE
STD_ALPHA_FORM.Show
End Sub

Private Sub cmdstudent_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblstdhelp.Visible = True
cmdstudent.Caption = "CLICK ME!"
lblstihelp.Visible = False
cmdsti.Caption = "STI"
lblfacultyhelp.Visible = False
cmdfaculty.Caption = "Faculty"
End Sub

Private Sub Form_Load()
LOG_IN_FORM.Hide
Unload LOG_IN_FORM
lblstdhelp.BackStyle = vbTransparent
lblstihelp.BackStyle = vbTransparent
lblfacultyhelp.BackStyle = vbTransparent
End Sub


Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblstdhelp.Visible = False
cmdstudent.Caption = "Student"
lblstihelp.Visible = False
cmdsti.Caption = "STI"
lblfacultyhelp.Visible = False
cmdfaculty.Caption = "FACULTY"
cmdlogout.Caption = "Log Out"
End Sub

Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblstdhelp.Visible = False
lblstihelp.Visible = False
lblfacultyhelp.Visible = False
cmdstudent.Caption = "Student"
cmdlogout.Caption = "Log Out"
cmdsti.Caption = "STI"
cmdfaculty.Caption = "Faculty"
End Sub




Private Sub Form_Load()
Unload LOG_IN_FORM
USER_INTERFACE.Hide

End Sub



Was This Post Helpful? 0
  • +
  • -

#8 zeinzu_kyasuchiro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-January 12

Re: error on *mdb loading at VB

Posted 23 January 2012 - 10:23 AM

ok. some of the problem are fixed. the only problem now is whenever i press the student button the userinterface wont hide.
Was This Post Helpful? 0
  • +
  • -

#9 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 550
  • View blog
  • Posts: 2,911
  • Joined: 19-May 09

Re: error on *mdb loading at VB

Posted 24 January 2012 - 04:13 PM

You're better off loading the UI form without showing it (use Load rather than Show). During the load event, show the login form modally. After you unload the login form, decide whether to show or unload the UI form. This way, the UI form becomes a consumer of the login functionality which is easier to control than trying to line up login and UI behaviors and chain them together.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1