LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-09-2003, 02:26 PM   #1
Linh
Member
 
Registered: Apr 2003
Posts: 178

Rep: Reputation: 30
Bug in MS Access Code


I had a Microsoft Access 2000 form. When I clicked on the button
with the code below it gives me an error

"compile error: user-defined type not defined"
It highlighted the error on the code

Dim Dbs As Database

==================================
Code:
Option Compare Database
Option Explicit

Private Sub Command1_Click()

    Dim Dbs As Database
    Set Dbs = CurrentDb

    Dim Tenant_Number_Temp As String
    Dim Unit_Number_Temp As String
    Dim Last_Name_Temp As String
    Dim First_Name_Temp As String
    Dim counter As Long
    
    Tenant_Number_Temp = "T-100-11-2-1999"
    Unit_Number_Temp = "1000"
    Last_Name_Temp = "Sacramento"
    First_Name_Temp = "Jayson and John"
    counter = 0
    Do While counter < 10
        counter = counter + 1
        Text_10.SetFocus
        Text_10.Text = counter
        
        Dbs.Execute " INSERT INTO Customer " _
        & "(Tenant_Number, Unit_Number, Last_Name, Fist_Name) VALUES" _
        & "('" & Tenant_Number_Temp & "','" & Unit_Number_Temp & "','" & Last_Name_Temp & "','" & First_Name_Temp & "');"
    Loop
    MsgBox "The loop made " & counter & " repetitions."
End Sub
 
Old 10-09-2003, 02:43 PM   #2
webtoe
Member
 
Registered: Apr 2001
Location: Cambridge, England
Distribution: Slackware 10, Fedora Core 3, Mac OS X
Posts: 617

Rep: Reputation: 30
Well maybe there is something syntaxically wrong with that statement. Maybe you should ask this on a MS Access forum (or atleast a windows forum).

Its very possible that few people in linux world know Visual Basic for Applications. I for one have forgotton most stuff.

Alex
 
Old 10-09-2003, 02:47 PM   #3
Linh
Member
 
Registered: Apr 2003
Posts: 178

Original Poster
Rep: Reputation: 30
reply

"Violence is the refuge of the incompetant"
--Isaac Asimov

I agree. Write your congressman, but nothing will change, because
http://www.newswatchmagazine.org
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kde: i want to access the logout source code and change it. Doomhammer Linux - Software 1 10-18-2004 01:13 PM
Possible gamepad code bug? Requesting testers. Dr Twox Linux - Hardware 1 07-09-2004 08:24 PM
error in Access 2000 code Linh Programming 2 10-13-2003 09:42 AM
Bug in c code calling bash code Linh Programming 11 08-12-2003 04:27 AM
Bug in C code Linh Programming 3 07-07-2003 06:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration