Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 8th, 2003, 04:58 PM
Dean Warrington Dean Warrington is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 Dean Warrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 sec
Reputation Power: 0
Database Form Problem

I am trying to create a form that has a predictive field that Automatically predicts and completes the name that I am typing, and when I press tab the remaining Address and Postcode fields are automatically completed. All of this information is taken from one table as a source and is to be compiled into another separate table.

The problem I am having is that I can create a predictive field that completes what I type, I can also create VBA that will auto fill the remaining address and postcode fields automatically but I can not make both of these things work together. It seems I must have one or the other. (I must completely type the whole name and press tab to have the Address field and postcode field fill automatically or have the predictive field complete the name I type and enter the Address and Postcode Manually.

My question is
Why will they not work together?

Is there a way around this Problem?

Reply With Quote
  #2  
Old May 9th, 2003, 07:02 AM
epl epl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Dublin
Posts: 413 epl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 18 sec
Reputation Power: 13
i don't understand where your problem is - i would expect what you describe to work but can't really help without some sample code

Reply With Quote
  #3  
Old May 9th, 2003, 12:10 PM
Dean Warrington Dean Warrington is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 Dean Warrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 sec
Reputation Power: 0
The Code

Hello EPL

The only way I know to make a field predictive of what I type is by using a Lookup (this is where I think my problem lies.)

This is the code to allow the Auto Fill of Start Location And Start Postcode but this code will not work if the Startpoint was chosen from a Lookup.

Private Sub StartPoint_Exit(Cancel As Integer)
Dim varStartLocation, StartPC As Variant
varStartLocation = DLookup("ADDRESS", "tblPointsInfo", "NAME = [StartPoint]")
varStartPC = DLookup("POSTCODE", "tblPointsInfo", "NAME = [StartPoint]")
If (Not IsNull(varStartLocation)) Then Me![StartLocation] = varStartLocation
If (Not IsNull(varStartPC)) Then Me![StartPC] = varStartPC
End Sub

I have a table called “tblPointsInfo” this is where the information is being referenced from, I also have a table called “Questions” this is where the information being entered into the form is going.

I hope this elaborates a bit more and thank you for your time and effort.

Reply With Quote
  #4  
Old May 9th, 2003, 12:46 PM
epl epl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Dublin
Posts: 413 epl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 18 sec
Reputation Power: 13
the easiest / quickest thing to do is to modify your dlookup criteria parameters as follows:
Code:
varStartLocation = DLookup("ADDRESS", "tblPointsInfo", "NAME = """ & strName & """"")
varStartPC = DLookup("POSTCODE", "tblPointsInfo", "NAME = """ & strName & """"")

Reply With Quote
  #5  
Old May 11th, 2003, 06:46 AM
Dean Warrington Dean Warrington is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 Dean Warrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 sec
Reputation Power: 0
Many Thanks!

Many Thanks EPL

I managed to locate the problem as being something to do with using a Lookup and not a Combo Box - Since using a combo box in conjuction with the Code everything is working great.

Thank you very much for your time.

Regards Dean

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Database Form Problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap