Solved

snapshots

Posted on 1998-08-26
5
314 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
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 200 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now