Module for Access VBA read image from table

Asked By 10 points N/A Posted on -
qa-featured

Will Access VBA read image from table, if so please sent me the module that will read a value directly from an Access  table using VBA code?

SHARE
Best Answer by Schneider Matthew
Best Answer
Best Answer
Answered By 0 points N/A #165263

Module for Access VBA read image from table

qa-featured

Hi Rosellas Phillips,

Please find the below code snippet that may help your problem. This reads table as a record set.

Sub Readdb()

   Dim d As Database

   Dim r As Recordset

   Dim Price As Field, Qty As Field, UnitCost As Field

   Set d = CurrentDB()

   Set r = d.OpenRecordset("TableName")

   Set Price = r.Fields("Price")

   Set Qty = r.Fields("Qty")

   Set UnitCost = r.Fields("UnitCost")

   While Not r.EOF

      r.Edit

      Price = Qty * UnitCost

      r.Update

      r.MoveNext

   Wend

   r.Close

End Sub

Hope it helps

Answered By 0 points N/A #165264

Module for Access VBA read image from table

qa-featured

Hi,

Here's the code that you will need!

You will open a record, set object, find the record, and edit the field:

Code Snippet

Dim db As DAO.Database

Dim rst As DAO.Recordset

Dim strSQL As String

Set db=CurrentDB()

strSQL=""SELECT YourNumericField FROM YourTable WHERE … YourCondition=…. ""

set rst=db.OpenRecordset(strSQL, dbOpenDynaset)

With rst

   If .RecorCount>0 Then

      .MoveFirst

      .Edit

      !YourNumericField = Your value

      .Update

   End If

End With

Regards

Related Questions