Solved

snapshots

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Access combo box help 2 46
Copy a row 12 62
VBA: Personal Macro Retain/Highlight/Remove values in a selected column 4 30
Zip Folders Using Chilkat Routines 1 39
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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