record source property

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Does anyone know a good source on the web for information
on how to correctly write/edit the record source property
of a form, particularly "INNER JOIN" when including
multiple tables. I've tried the help in Access and the
VBA window. No luck.
 
Michael,

The syntax is:
Me.RecordSource = "Select ................."
or
Forms!MyForm.RecordSource = "Select ..................."

Note that the Select statement is enclosed in quotes.

To get the Select statement, create your query that you want to base the form on
and then go to SQL view and do a copy and paste.

PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com
 
I am looking at the form in design view (Access 2000) and
looking at the record source property. I would like to
edit it because I added 2 text boxes that I set the
control source to a table that was not originally used for
the form. I added both fields to the "Select" section of
the record source. The relationship of this table is
related to information in the form by matching two
fields. This is where the problem comes in, I think. I
am guessing that I need to add someting to the "FROM"
section of the record source, maybe in the form of INNER
JOIN.
Hopefully that makes sense. Do you know a resource of
more information on writing the record source property.
 
Open your form in design view and copy the SQL statement in the record source
property. Go to queries and click on New. Switch the view to SQL view. You'll
see just "Select;" there. Paste in your SQL from the form so it overwrites the
"Select;". Now switch that query to design view. You can now do whatever editing
is needed. Then switch back to SQL view and copy and paste the SQL as previously
described.
 
I'm an advocate of using an autonumber field in tables for the primary key.
Access was designed to work with autonumber primary keys - many of the things it
does relies on autonumber. My recommendation would be to add an autonumber field
to your tables and make it the primary key and you will probably see your
problem go away.

PC Datasheet
www.pcdatasheet.com
 
Back
Top