Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2014, 07:54 AM
Registered User
 
Join Date: Nov 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query from multiple tables-Error

Hi!!!
Code:
Private Sub Command1_Click()
Dim psql
 cn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\Dictionary.mdb"
 cn.Open
  rs.Open "Select Spanish.*, English.* from Spanish, English", cn, adOpenDynamic, adLockOptimistic
If Right$(Text2.Text, 2) = "ed" Then
Text2.Text = Left$(Text2.Text, Len(Text2.Text) - 2)
     psql = "SELECT Spanish.Verbpast FROM English INNER JOIN Spanish ON English.Spsh_ID = Spanish.Spsh_ID WHERE English.Verbpresent= '" & Text2.Text & "'"
 rs.MoveFirst
    rs.Requery psql
If Not rs.EOF Then
    Text3.Text = rs(“Verbpast”)
End If
End If
End Sub
The two tables are linked by the SpshId. . I want to get the past tense of a verb in Text3 if I type the past form of a verb. But I get ‘Type mismatch’ error.

Can anybody help me on it?

Last edited by Kvanch; November 10th, 2014 at 08:00 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inner join query with multiple tables.. rupen Access 2 April 9th, 2007 11:16 AM
UPDATE query throws error in selective MSI tables eelisMX General .NET 0 July 14th, 2005 06:29 AM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM
Multiple Recordsets from Multiple Tables TSEROOGY Classic ASP Databases 2 December 28th, 2004 12:45 PM
Multiple Joins in Multiple Table Search query pookster Access 4 September 23rd, 2004 03:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.