Re: Open a form, using a sql string.
- From: "tina" <nospam@xxxxxxxxxxx>
- Date: Sat, 23 Apr 2005 04:23:13 GMT
if i understand you correctly: you have a table with 36 fields. you want to
be able to select any one of those 36 fields to display in a form, at
runtime.
you could create a SQL string and assign it to the form's RecordSource every
time you open the form, but you'd also have to set the control's
ControlSource to the appropriate field name. seems like the easiest thing is
to include all the table fields in the form's RecordSource. then, the only
issue is changing the ControlSource of the control on the form, to the name
of the table field you want to display.
you might try using the OpenArgs argument of the DoCmd.OpenForm method, to
supply the name of the field selected from the droplist. put code in the
second form's Load event, to set the control's ControlSource to Me.OpenArgs.
if it doesn't work in the Load event, try running it in the form's Open
event.
hth
"g m via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:1c506c0a25394be88da6e2442af81764@xxxxxxxxxxxxxxxxxxxx
> I need to have an efficient way of reporting any one of (36) fields in a
> table.
>
> I have a table called mailingList which has fields Title, Prod_ref, Date
....
>
> I have created a look-up table called attributes
>
> has the following fields :- current_selection
> which has values like - Title, Prod_ref, Date...
>
> and view_item. (for the drop-down list)
> which has entries like - Customer Title, Product Reference, Order
Date.....
>
> With the attribute selected, I then want to open another form, and return
> appropriate records. I am quite new to VB, but I think it should be a
> docmd.openform, but I cannot get the sql string to work.
>
> In essence, the sql will be something like -
>
> select [current_selection from mailinglist.
>
> I am struggling with the syntax.
>
> Any ideas?
>
> Regards
>
> Gordon.
>
> --
> Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Open a form, using a sql string.
- From: g m via AccessMonster.com
- Re: Open a form, using a sql string.
- References:
- Open a form, using a sql string.
- From: g m via AccessMonster.com
- Open a form, using a sql string.
- Prev by Date: Re: strategy for data entry in multiple tables
- Next by Date: Re: Search form only works for me
- Previous by thread: Open a form, using a sql string.
- Next by thread: Re: Open a form, using a sql string.
- Index(es):
Relevant Pages
|