Row Source

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating a form based on a table called Purchase. In this table I insert
purchase data and I choose the specific month that data was collected. The
way I have set up the month field in this table is through a lookup wizard
displaying the MonthID from the MonthTable. On this Month table I have two
fields, one is the MonthID and the other one is the MonthDescription which
include month and year.

What I want my form to do is to display these MonthDescriptions in a
combobox so that the user knows which month he/she is choosing but I want it
to save MonthID instead of the description.

I have looked at the Northwind example, and even though I have tried to to
follow it, my row sorce code is not working properly and is still displaying
MonthID in the form view.

This is what I have right now:
SELECT DISTINCT MonthTable.MonthID, [MonthName] AS [Month] FROM MonthTable;
Coding is definitely one of my weak spots, therefore I have no idea what I'm
doing.

Please help.

THANKS!!
 
Look at the SQL statement in query design view. Put the MonthID field (the
one you want stored) leftmost in the design grid, with the field you want
displayed next to it. Make sure the combo box is bound to MonthID in the
underlying table or query. In the combo box property sheet set the bound
column to 1, the column count to 2, and the column widths to 0;l.5" (second
number can be whatever you want).
 
Back
Top