RE: Help Needed
- From: BigGuyKen <BigGuyKen@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Apr 2005 15:06:00 -0700
Yes this is an Access form, and this form is being used to gather criteria to
be used in the SQL Query. I have my "All Drawings and One Drawing" in an
"Option Group" and the values the user can select are in a "ComboBox" beside
it. By removing the 'Control Source' property, I can no longer change the
Option Group or select a different value from the ComboBox list, which is
loaded by the Select Distinct for the field from the table.
If you need anything further, let me know.
Thanks..
"Ted Allen" wrote:
> I'm not sure I completely follow, I'll ask a few more questions if you don't
> mind.
>
> Is this an Access form?
>
> What is the main purpose of the form? Are you gathering criteria to be used
> to construct the sql for the report data source?
>
> If so, it sounds like this is kind of a query by form setup. If this is the
> case, many would usually do something similar to the following:
>
> create an unbound form (no form record source, no control control sources)
>
> create checkboxes, combo boxes, etc to allow the user to specify criteria.
> For the combo boxes, set the rowsource type and rowsource as applicable. (by
> the way, in your case, you may want to consider checkboxes for the "Include
> All WO's" and "Include all Drawings" options.
>
> create a query that references the form control values as necessary to
> return the desired records (using Forms![YourFormName]![YourControlName])
>
> create a report that uses the query as it's record source.
>
> Alternatively, for more complex queries, we would usually use VBA to just
> construct the query sql and use that for the report's query.
>
> Offhand, I can't think of why Access will not let you change the values in
> unbound combo boxes, I haven't encountered that before. But, hopefully
> something above will give you an idea. If not, post back with a little more
> detail as to the process that you are using.
>
> -Ted Allen
>
> "BigGuyKen" wrote:
>
> > It works somewhat. I am using a select distinct to fill the values that the
> > user can select for each field. In front of each field is a combo box that
> > has options of "All Drawings or One Drawing" and "All Work Orders or One Work
> > Order". I can now not change what is selected in the combo box. At least
> > you were right, it does not change the value of those fields in the first
> > record.
> >
> > Any new suggestions? Thanks....
> >
> > "Ted Allen" wrote:
> >
> > > Hi Ken,
> > >
> > > First, a disclaimer. Your post said that you are creating the form in
> > > Visual Basic, but I am assuming that you meant the form was created in Access
> > > and you have created some code in Visual Basic for Applications. If that is
> > > incorrect, the following may not apply, although the resolution may still be
> > > similar.
> > >
> > > It sounds like your form controls are likely bound to the table fields, and
> > > the OnLoad event is changing their values for the current (first) record.
> > >
> > > If you are only using the controls to generate reports, and don't need to
> > > use them to change existing data in the table, you can probably correct the
> > > problem that you are encountering by unbinding the controls. To do this, all
> > > you would have to do is go to the control properties and delete the entry for
> > > the "Control Source" property.
> > >
> > > If you want to use the form to make edits as well as generate the reports,
> > > so you want the controls to be bound, you would probably want to revise the
> > > code to navigate to the proper record in the form, rather than changing the
> > > control values for the current record.
> > >
> > > If that is the case, Access has a wizard for new combo boxes that will
> > > generate code for you to navigate to a record. You can probably adapt that
> > > code to your situation pretty easily. The general process is to set a
> > > recordset = to Me.Recordsetclone, then use FindFirst on that recordset.
> > > Then, you check the recordset.NoMatch property to see if a match was found,
> > > and if so you set the form bookmark equal to the recordset bookmark.
> > >
> > > Post back if my assumptions were incorrect, or if you would like more detail
> > > on any of the above.
> > >
> > > HTH, Ted Allen
> > >
> > > "BigGuyKen" wrote:
> > >
> > > > I have an Access table that I want to select certain information from and run
> > > > a report. Using Visual Basic I have set up a form that the user can select 2
> > > > different fields on. The 2 fields are drawing number and work order number.
> > > > When the form displays, I want the values in the selection boxes to be the
> > > > current drawing and the current workorder that the user is looking at in
> > > > AutoCad. I have figured out that by using the "On Load" of the form that I
> > > > can get those values to be the displayed value. When I run the report, it is
> > > > correct. If I turn around and run the report again, there is an additional
> > > > record on the report. It happens to be the first record in the Access table.
> > > > Apparently by using the "On Load" property, it chages and saves the values
> > > > to the first record in the table.
> > > >
> > > > How do I get these values to not save? I am extremely new to this type of
> > > > programming and any help would be greatly appreciated.
> > > >
> > > > Thanks for any and all help I may receive.
> > > > Ken.
.
- Follow-Ups:
- RE: Help Needed
- From: Ted Allen
- RE: Help Needed
- References:
- Help Needed
- From: BigGuyKen
- RE: Help Needed
- From: Ted Allen
- RE: Help Needed
- From: BigGuyKen
- RE: Help Needed
- From: Ted Allen
- Help Needed
- Prev by Date: RE: Update Query?
- Next by Date: RE: Stumped on query, group count max type
- Previous by thread: RE: Help Needed
- Next by thread: RE: Help Needed
- Index(es):
Relevant Pages
|