By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Temporary tables in A2K/ADO

P: n/a
I trying to build a form that would be bound to a temporary table, if
possible. The purpose of the form is to allow a user to select certain
records from a table with a checkbox. Then there would be a button on the
form that would insert records into another table. So the form should return
records from table1. Next to each record would be a checkbox. The temporary
table should store a field from table1 and the yes/no value from the
checkbox.

I don't want to create an additional permanent table to store the value of
the checkbox. I don't want to add a field to table1 that would store the
checkbox value.

Any thoughts would be appreciated.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
If you are suggesting an in-memory table, I believe only ADO.Net
supports that. With Com ADO (what Access uses) you have to use Create -
which makes it disk based. I noticed that I am migrating more and more
of my Access apps to VB.Net for this reason. A datagrid and ADO.Net in
a VB.Net app has way more functionality than the same in Access - not to
put Access down - it is still the best desktop database system around.
So my suggestion would be to try what you are doing in VB.Net

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2

P: n/a
I appreciate the response but VB.Net is not an option.

"Rich P" <rp*****@aol.com> wrote in message
news:PF****************@news.uswest.net...
If you are suggesting an in-memory table, I believe only ADO.Net
supports that. With Com ADO (what Access uses) you have to use Create -
which makes it disk based. I noticed that I am migrating more and more
of my Access apps to VB.Net for this reason. A datagrid and ADO.Net in
a VB.Net app has way more functionality than the same in Access - not to
put Access down - it is still the best desktop database system around.
So my suggestion would be to try what you are doing in VB.Net

Rich

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #3

P: n/a

Rather then using a temporary table, use a form with a list control on
it, bound to the table (or a query) of the source records. In the
close event of this form (a pop-up/dialog box), write back to the
calling form the records selected by the user.

Example (as always, watch out word wrap!).

Ahhh... This code is actually called by command button on the a form
that doesn't have a close button on it. The Function returns "True"
if the user cancels, which stops the form from closing (Cancel =
True).

It should also be noted that the code writes back to the calling form
a comma delimited string, which you'll have to do your own processing
on to make use of in your application.
Private Function SelectAccounts() As Boolean
Dim strOut As String
Dim strForm As String
Dim strControl As String

Dim I As Integer
If Me.lstAccounts.ItemsSelected.Count > 0 Then
For I = 0 To Me.lstAccounts.ItemsSelected.Count - 1
strOut = strOut & _
Me.lstAccounts.Column(0, _
Me.lstAccounts.ItemsSelected(I)) & _
","
Next
strOut = Left$(strOut, Len(strOut) - 2)
Else
Select Case MsgBox("No Accounts Selected!" & vbNewLine & _
"Continue?", _
vbYesNoCancel, _
"No Accounts Selected Warning")
Case vbYes
Case vbNo, vbCancel
ReturnAccounts = True
End Select
End If
If Len(Me.OpenArgs & "") > 0 Then
' passed to this function is the name of the form
' that called it
' and the control within that form to write back to.
' this code passes the selections back
' sample open command that passes the control to this form:
' DoCmd.OpenForm "frmSelectMultipleAccounts", _
acNormal, , , , acDialog, _
"Forms!" & Me.name & _
".txtMulitpleAccountSelections"
strForm = Mid$(Me.OpenArgs, InStr(Me.OpenArgs, "!") + 1)
strControl = Mid$(strForm, InStr(strForm, ".") + 1)
strForm = Left$(strForm, InStr(strForm, ".") - 1)
If IsLoaded(strForm) Then
Forms(strForm).Controls(strControl).Value = strOut
End If
End If
End Sub
On Fri, 5 Aug 2005 11:31:16 -0600, "Terri" <te***@cybernets.com>
wrote:
I trying to build a form that would be bound to a temporary table, if
possible. The purpose of the form is to allow a user to select certain
records from a table with a checkbox. Then there would be a button on the
form that would insert records into another table. So the form should return
records from table1. Next to each record would be a checkbox. The temporary
table should store a field from table1 and the yes/no value from the
checkbox.
I don't want to create an additional permanent table to store the value of
the checkbox. I don't want to add a field to table1 that would store the
checkbox value.

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.