Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How open form to selected record in a listbox

Posted on 2014-01-15
2
Medium Priority
?
2,685 Views
Last Modified: 2014-01-16
I'm trying to open a form (form #2) to a selected record in a listbox in form #1.

Here is my code which doesn't work...

DoCmd.OpenForm "frmPlantedBayQtys", , , "[PlantedBayID] = " & Chr(34) & Me.ListBayQty.Column(1) & Chr(34)

Note that PlantedBayID in numberic.
0
Comment
Question by:SteveL13
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39784210
try this,

DoCmd.OpenForm "frmPlantedBayQtys", , , "[PlantedBayID] = " &  Me.ListBayQty.Column(1)


what values do you get in Me.ListBayQty.Column(1) ?
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 39784360
Steve,

Are you really interested in the 2nd column of the listbox, or the one that is the bound column?  Listboxes are zero based, so by referring to column(1) you are actually looking at the 2nd column in the Listboxes RowSource.

is the field [PlantedBayID] a number or a string?  if it is a number, Capricorn1's example above should work.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question