Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Sql insert statment from from list box to table or form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeremy0028@gmail.com - 03 Dec 2007 04:45 GMT
I have the following list box called list0 with the following in row
source.

SELECT tblCityStateZip.City, tblCityStateZip.State,
tblCityStateZip.Zip
FROM tblCityStateZip;

i have a form called  frmpeople with the following

PeopleID
LastName
FirstName
Address
City
State

Zip(Combo Box)
SELECT tblCityStateZip.Zip, tblCityStateZip.City,
tblCityStateZip.State
FROM tblCityStateZip;

What i want to do is when user double clicks on city state zip in the
list box will insert those in the form called people where it says
City,State,Zip.

Any ideas.
Steve Schapel - 03 Dec 2007 08:32 GMT
Jeremy,

Well, is the list0 listbox also on the frmpeople form?  Or, if it's on
another form, is the frmpeople form open at the time?

Any reason for wanting to use double click, as against just selecting an
item from the listbox?

Anyway, code could be something like this...

   With Forms!frmpeople
      !City = Me.List0
      !State = Me.List0.Column(1)
      !Zip = Me.List0.Column(2)
   End With

... or, if list0 is on the same form:

   Me.City = Me.List0
   Me.State = Me.List0.Column(1)
   Me.Zip = Me.List0.Column(2)

Signature

Steve Schapel, Microsoft Access MVP

> I have the following list box called list0 with the following in row
> source.
[quoted text clipped - 22 lines]
>
> Any ideas.
jeremy0028@gmail.com - 04 Dec 2007 03:01 GMT
> Jeremy,
>
[quoted text clipped - 50 lines]
>
> - Show quoted text -

Yes the list box is on another form called frmDuplicateZipcode. Since
some cities can have the same zipcode associated with them the form
pops up when user enters zipcode in the combobox on the frmpeople to
make user aware there are 2 or more cities associated with that zip
code.  Then user double clicks the the correct city and will insert
that into the frmpeople where it says City,State, Zip.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.