in the Change Event for the list box, ListBproduct.
I make sure setfocus for the ListBproduct at the end.

  Dim bin as BinaryStream
  Dim f as FolderItem
  Dim pic as Picture
  Dim i As Integer
  Dim query As String
  
  If Me.ListIndex > -1 Then
    // Get Database Record For Selection
    rsProduct = App.CatalogDB.SQLSelect("SELECT * FROM
Product WHERE id = " +
ListBproduct.Cell(ListBproduct.ListIndex, 0))
    
    // Display Data
    If rsProduct <> Nil And rsProduct.RecordCount > 0
Then
      
      query = "SELECT id, Category FROM Category ORDER
BY Category"
      AddrowsCombo( cbCategory, query, "Category",
"id", rsProduct.Field( "Category_id" ).IntegerValue )
      
      query = "SELECT id, Type FROM Type ORDER BY
Type"
      AddrowsCombo(cbType, query, "Type", "id",
rsProduct.Field( "Type_id" ).IntegerValue )
      
      EFproduct.Text =
LTrim(rsProduct.Field("Product").StringValue)
      EFpinyin.Text =
LTrim(rsProduct.Field("Pinyin").StringValue)
      EFcProduct.Text =
LTrim(rsProduct.Field("cProduct").StringValue)
      EFbrand.Text =
LTrim(rsProduct.Field("Brand").StringValue)
      EFcBrand.Text =
LTrim(rsProduct.Field("cBrand").StringValue)
      EFManufact.Text =
LTrim(rsProduct.Field("Manufacturer").StringValue)
      EFIndications.Text =
LTrim(rsProduct.Field("Indications").StringValue)
      EFDescription.Text =
LTrim(rsProduct.Field("Description").StringValue)
      EFComment.Text =
LTrim(rsProduct.Field("Comment").StringValue)
      EFIngredients.Text =
LTrim(rsProduct.Field("Ingredients").StringValue)
      EFcIngredients.Text =
LTrim(rsProduct.Field("cIngredients").StringValue)
      EFDirections.Text =
LTrim(rsProduct.Field("Directions").StringValue)
      EFcaution.Text =
LTrim(rsProduct.Field("Caution").StringValue)
      ChkBHide.Value =
rsProduct.Field("Active").BooleanValue
      If rsProduct.Field("Thumbnail").StringValue.Len
> 0 Then
        
        // Temp File
        f = TemporaryFolder.Child("Temp Image")
        
        // Save the Image to the File
        bin = f.CreateBinaryFile("")
        If bin <> Nil Then
          // Write Image
          bin.Write
DecodeBase64(rsProduct.Field("Thumbnail").StringValue)
          bin.Close
        end if
        
        // Read it back in if it exists
        if f.Exists then
          pic = f.OpenAsPicture
        end if
      End If
      IWImage.Image = App.MakeThumbnail( pic )
      
    else
      
      // Clear Data In Fields
      CBcategory.Text = ""
      CBtype.Text = ""
      EFproduct.Text = ""
      EFpinyin.Text = ""
      EFcProduct.Text = ""
      EFbrand.Text = ""
      EFcBrand.Text = ""
      EFManufact.Text = ""
      EFIndications.Text = ""
      EFDescription.Text = ""
      EFComment.Text = ""
      EFIngredients.Text = ""
      EFcIngredients.Text = ""
      EFDirections.Text = ""
      EFcaution.Text = ""
      ChkBHide.Value = False
      IWImage.Image = Nil
    End If
  end if
  ListBproduct.SetFocus

--- CV <[EMAIL PROTECTED]> wrote:

> 
> On May 29, 2006, at 2:10 PM, Long Huynh wrote:
> 
> > Once I click on the listbox, my codes fill out the
> > data for the EditFields just fine, but my up and
> down
> > arrow keys don't work.
> 
> What editfields are you referring to? What code do
> you have and where  
> is it located?
> 
> 
> Best,
> 
> Jack
> 
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives of this list here:
>
<http://support.realsoftware.com/listarchives/lists.html>
> 

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to