RE: Return a number for calculation purposes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



It was the Column(1) solution that worked...thanks!

"SteveS" wrote:

> "Gee..." wrote:
>
> > I have a database for pulling up jpg files. The user has 8 drop-down combo
> > boxes to choose from.
> > When done, this:
> > ([Combo1] & "_" & [Combo3] & "_" & [Combo7] & "_" & [Combo10] & "_" &
> > [Combo12] & "_" & [Combo14] & "_" & [Combo16] & "." & [Combo19])
> >
> > Becomes this, which is the jpg file name, in Textbox221:
> > 900_DDA_AF_COLOR_150_MIXED_LARGE.JPG
> >
> > I also have the following, which looks in my "List" table and finds the
> > record for that jpg file that matches the “file name”, in TextBox142:
> >
> > \JP-server13\database\JPG File\" & [Combo1] & "_" & [Combo3] & "_" &
> > [Combo7] & "_" & [Combo10] & "_" & [Combo12] & "_" & [Combo14] & "_" &
> > [Combo16] & "." & [Combo19])
> >
> > I use it to populate a “file size” combo box and a “score” combo box…both
> > are numbers. I’ve got the properties set like this:
> > Name: Combo277
> > Control Source: Text 221
> > Format: Standard
> > Row Source Type: Table/Query
> > Row Source: SELECT LIST.[File Name], LIST.[File Size] FROM LIST;
> > After Update: [Event Procedure]
> > Which is this:
> >
> > Private Sub Combo277_AfterUpdate()
> > ' Find the record that matches the control.
> > Dim rs As Object
> >
> > Set rs = Me.Recordset.Clone
> > rs.FindFirst "[File Name] = '" & Me![Combo277] & "'"
> > If Not rs.EOF Then Me.Bookmark = rs.Bookmark
> > End Sub
> >
> > I need to use the Score and File Size to do some calculations. When I try
> > to reference the Combo Boxes (227 and 305) and get the number they are
> > displaying, I get 9500_DNA_ADF_COLOR_75_MIXED_LARGE instead…which is the
> > Control Source instead of the end result of the Combo Box.
> >
> > What am I doing wrong, please.
> > Thank you for your help.
> > Greta
> >
>
> Hi Greta,
>
> For Combo227 (you didn't post anything about Combo305), you have two columns
> for the row source: [File Name] and [File Size]. To get the file size you
> need to use the Column() property and referance the second column:
>
> forms!YourForm!Combo227.Column(1)
>
> The row source column count is zero based, so the second column ([File
> Size]) is column 1.
>
>
> In the after update event of Combo227, you created an object. You should add
> two lines before the end sub:
>
> rs.Close
> Set rs = Nothing
>
>
> Everything else is confusing me.... (since I can't see your database<g>). It
> looks like there are 8 unbound combo boxes (in the form header?) and a
> calculated(?) text box (Textbox221) that holds the jpg file name. And another
> (calculated?) text box holds the fully qualified file name of the jpg.
>
> Combo227 is bound to the (calculated?) control Textbox221, that changes the
> form current record in the after update event, which seems to defeat the
> purpose of having the combo box bound....(and might lead to data
> confusion/corruption....)
>
> Again, I can't see your database, so I am easily confused.... :-O
>
> HTH
> --
> Steve S
> --------------------------------
> "Veni, Vidi, Velcro"
> (I came; I saw; I stuck around.)
.



Relevant Pages

  • Cannot insert Pictures again
    ... We manage to insert the photos for Employee on ... I have given an advice to use the MS Common Dialog Control ... Common Dialog API in an Access Database. ... ImageBox is the name of the container for the JPG file. ...
    (microsoft.public.access.forms)
  • Cannot insert Pictures again
    ... We manage to insert the photos for Employee on ... I have given an advice to use the MS Common Dialog Control ... Common Dialog API in an Access Database. ... ImageBox is the name of the container for the JPG file. ...
    (microsoft.public.access.forms)
  • Re: VB and SQL
    ... table.field1 is the name of a JPG file that is linked to ... my database and viewable in various forms. ... table.field1 is merely a filename. ... table.field1 where the worl delete occurs in another ...
    (microsoft.public.access.queries)
  • Re: Need best map component.
    ... > To do that you will need a database with places to search and the ... Then you can re-center the map on those ... Use a TRasterTable to load the jpg file. ... Ok.That's what i think i should be.Do you know how 'encarte' solve this ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: Return a number for calculation purposes
    ... > boxes to choose from. ... > I need to use the Score and File Size to do some calculations. ... > Control Source instead of the end result of the Combo Box. ... calculatedtext box that holds the jpg file name. ...
    (microsoft.public.access.formscoding)