Senin, 06 Agustus 2012

Re: [MS_AccessPros] Change a value of a combo box with VBA

 

Hi Jim,

That looks good.

In that case the ControlSource of the Combo should
be TaskTypeID and the FieldType in tblTask should
be a Long.

You could also check the Join between tblTaskType.TaskTypeID
and tblTask.TaskTypeID and make sure that tblTaskType is
on the One side of the Join, and tblTask is on the many
side.

I hope I got that right. I was going boss-eyed
for a moment <g>. Tablenames being duplicated in the
fieldnames wastes space, though I know that is the
trend these days.

Regards, Clive.

--- In MS_Access_Professionals@yahoogroups.com, Jim Wagner <luvmymelody@...> wrote:
>
> Clive 
>
> Currently I store the TaskTypeID in the table. I just link the tables in the queries to get the actual type proper name.
>
>  
> Jim Wagner
> ________________________________
>
>
>
> ________________________________
> From: Clive <zctek@...>
> To: MS_Access_Professionals@yahoogroups.com
> Sent: Monday, August 6, 2012 9:28 AM
> Subject: Re: [MS_AccessPros] Change a value of a combo box with VBA
>
>
>  
> Hi Jim,
>
> What are you intending to store in the tblTask
> as shown in the cbo's ControlSource?
>
> the ID or the TaskType? You could store either
> as long as you are using the correct DataType
> and handle the join in any query if you strore the ID.
>
> I normally save the ID since it normally requires
> less space.
>
> Tell me if that is not clear.
>
> Regards, Clive.
>
> --- In MS_Access_Professionals@yahoogroups.com, Jim Wagner <luvmymelody@> wrote:
> >
> > Name: cboTaskType
> > Row Source: SELECT tblTaskType.TaskTypeID, tblTaskType.TaskType FROM tblTaskType ORDER BY [TaskType]; 
> > Column Count: 2
> > Bound Column: 1
> > Column Widths: 0";0.9896"
> >
> >
> > The tblTaskType has 2 columns. The TaskTypeID is a PK AutoNumber. The TaskType is a text field that has a field size of 50
> >
> >  
> > Jim Wagner
> > ________________________________
> >
> >
> >
> > ________________________________
> > From: Duane Hookom <duanehookom@>
> > To: "MS_Access_Professionals@yahoogroups.com" <ms_access_professionals@yahoogroups.com>
> > Sent: Monday, August 6, 2012 8:11 AM
> > Subject: RE: [MS_AccessPros] Change a value of a combo box with VBA
> >
> >
> >  
> > Jim,
> > Help us out by providing these properties of the combo box:
> > Row Source: (the SQL view)
> > Column Count:
> > Bound Column:
> > Column Widths:
> >
> > I expect the actual bound column is a hidden primary key like and ID.
> >
> > Duane Hookom
> > MS Access MVP
> >
> >
> > > To: MS_Access_Professionals@yahoogroups.com
> > > From: luvmymelody@
> > > Date: Mon, 6 Aug 2012 14:57:26 +0000
> > > Subject: [MS_AccessPros] Change a value of a combo box with VBA
> > >
> > > I have a button on my form that when it is clicked populates fields on a form. It is a record that is easier to populate with a button. I have added a combo box to the code and it does not like the line. The line is below. I get the error Run-time error 2113. The value you entered isn't valid for this field. I would like to understand why the value could be invalid. The value is in the combo box.
> > >
> > > Thank You for any definition
> > >
> > > Jim Wagner
> > >
> > > cboTaskType.Value = "Process"
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar