Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

snapshots

Posted on 1998-08-26
5
Medium Priority
?
352 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 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
Suggested Courses

972 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