Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

snapshots

Posted on 1998-08-26
5
Medium Priority
?
348 Views
Last Modified: 2010-04-30
Can I relate a snapshot from a table to a dynaset in another table?

thanks
Alberto
0
Comment
Question by:asimoes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1431109
I don'y understand your questionm can you provide more details?
0
 

Author Comment

by:asimoes
ID: 1431110
As I see it,  a snapshot is some information retrieved from a table that cannot be updatable and a dynaset can be updatable.
Well, in the relation of this two tables can i retrieve information of the first one (by a snapshot) for some fields (that I don't want to update) and relate them to the  second information of a second table that I must update ?
Another question: How can I format a text box for currency?
0
 
LVL 1

Expert Comment

by:rlarner
ID: 1431111
I don't understand what you mean by 'relate'.  Are you planning on opening up a 3rd recordset equal to a join of the two tables?  Are you going to loop through one table, finding related values in another table?  More information would be helpful.

Also -- you probably want to post the text box question seperately.
0
 
LVL 1

Accepted Solution

by:
JayMerritt earned 400 total points
ID: 1431112
Open the snapshot first, loop through it a record at a time and create new dynasets for each record in the snapshot.

DIM SS as RecordSet
DIM DS as RecordSet
Dim WS as WorkSpace
Dim DB as Database
' Create Microsoft Jet Workspace object.

Set ws = CreateWorkspace("", "admin", "", dbUseJet)
Set db = ws.OpenDatabase("MY.mdb", True)
'Open Snapshot first
sql = "SELECT * FROM tblTableA"
Set SS = DB.OpenRecordSet(sql, dbOpenSnapshot)
Do until SS.EOF
  sql = "SELECT * FROM tblTableB WHERE tblTableB.Key = " & Cstr(SS!tblTableA.Key))
  Set DS = DB.OpenRecordSet(sql, dbOpenDynaset)
  ' look at your dynaset here
 If DS.EOF Then
    ' nothing found
  Else
    ' something found
    DS.Edit
    DS!FieldA = "new value"
    DS.Update
  Endif
 DS.Close
  Set DS = Nothing
  SS.MoveNext
 ' go to next record in snapshot
Loop

0
 

Expert Comment

by:mskannan
ID: 1431113
Hi asimoes,
Regarding the second question, try this one.

MyStr = Format(5459.4, "$##,##0.00") returns $5,459.00

Also go to keypress event of text box and write code so that it allows only numbers to be keyed in the text box.

Regards,
mskannan


      
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question