I have a subform that is set in continuous form view. My VBA code fills in specific values in unbound fields on each form in the "On Current" event. The values are dependent on other fields in the form.
The problem I run into is that, because the records are continuous and therefore all visible, when I am on one record, the unbound fields on all records are given the values of the selected form. When I subsequently select a different record, all unbound fields change to the values associated with the new record.
Is there anyway to have each record show it's own values, irregardless of which record is selected?
Here's my code: - Public Sub NameLoader()
-
Dim db As DAO.Database
-
Dim rst As DAO.Recordset
-
Dim str As String
-
-
If IsNull(Me.NameID.Value) = True Then
-
Exit Sub
-
Else
-
str = "SELECT tblName.NameID, tblName.Email, tblName.Phone, tblName.TRRate, tblName.RevRate "
-
str = str & "FROM tblName WHERE (((tblName.NameID)=" & Me.NameID.Value & "));"
-
Set db = CurrentDb
-
Set rst = db.OpenRecordset(str)
-
-
Me.Email.Value = rst.Fields("Email").Value
-
Me.RevRate.Value = rst.Fields("RevRate").Value
-
Me.TRRate.Value = rst.Fields("TRRate").Value
-
Me.Phone.Value = rst.Fields("Phone").Value
-
-
End If
-
End Sub
3 1304
You can use a query and join them to get the fields or you can use the DLookup() function in the control source.
DLookup worked great, I'd never used it before. It'll help me in a lot of ways, thanks a lot.
R
You can use a query and join them to get the fields or you can use the DLookup() function in the control source.
DLookup worked great, I'd never used it before. It'll help me in a lot of ways, thanks a lot.
R
Not a problem, good luck.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Armando |
last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not
enough was available to see if this will be a PITA repeat question. Sorry
if it is.
On a form with its Default View...
|
by: Richard Hollenbeck |
last post by:
I have the following query in my form's code:
Private Function Get_Data(fieldNum As Integer)
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
strSQL = "SELECT & "", "" & ...
|
by: Doug Bell |
last post by:
Hi,
I am trying to create form that displays data like an Access continuous
dataform rather than using a data grid.
I am thinking that I can achieve this by creating a row of text boxes, one...
|
by: igendreau |
last post by:
I have a form, set to "Continuous Forms" to kind of give that
spreadsheet feel, but I need it in a Form because my detail section
contains some buttons I need.
In my form header, I have an "Add...
|
by: Edwinah63 |
last post by:
Hi everyone,
Please let there be someone out there who can help.
I have two BOUND combo boxes on a continuous form, the second being
dependent on the first. I have no problem getting the...
|
by: panwala_bhavesh |
last post by:
Thanks in advance... I have a form displaying the results of a query in
a continuous form style. I want to be able to double-click on the key
field of the form (a textbox, in this case a AssetID)...
|
by: Michael R |
last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form.
1st step: Create a textbox, send it to background...
|
by: blueheelers |
last post by:
I have been researching for several hours on the best way to display
images in continous forms in Access 2003. For example, I want to
display employee name, email, phone, and picture for each...
|
by: Lyn |
last post by:
I thought that in an earlier project I was able to click or double-click in
the detail section of a row in a continuous form and use the event to open
a detail form for that row.
However, now a...
|
by: rpboll |
last post by:
I am looking for the best way to accomplish the following continuous
forms concept.
There are Five Groups: A, B, C, D, E
Each group has eight Members: a, b, c, d, e, f, g, h
Each...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |