473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Continuous Forms Question

34
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:

Expand|Select|Wrap|Line Numbers
  1. Public Sub NameLoader()
  2. Dim db As DAO.Database
  3. Dim rst As DAO.Recordset
  4. Dim str As String
  5.  
  6. If IsNull(Me.NameID.Value) = True Then
  7.     Exit Sub
  8. Else
  9.     str = "SELECT tblName.NameID, tblName.Email, tblName.Phone, tblName.TRRate, tblName.RevRate "
  10.     str = str & "FROM tblName WHERE (((tblName.NameID)=" & Me.NameID.Value & "));"
  11.     Set db = CurrentDb
  12.     Set rst = db.OpenRecordset(str)
  13.  
  14.     Me.Email.Value = rst.Fields("Email").Value
  15.     Me.RevRate.Value = rst.Fields("RevRate").Value
  16.     Me.TRRate.Value = rst.Fields("TRRate").Value
  17.     Me.Phone.Value = rst.Fields("Phone").Value
  18.  
  19. End If
  20. End Sub
Oct 24 '07 #1
3 1304
Rabbit
12,516 Expert Mod 8TB
You can use a query and join them to get the fields or you can use the DLookup() function in the control source.
Oct 24 '07 #2
RAG2007
34
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.
Oct 24 '07 #3
Rabbit
12,516 Expert Mod 8TB
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.
Oct 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
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...
3
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 & "", "" & ...
11
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...
4
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...
9
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...
2
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)...
5
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...
1
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...
5
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...
1
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...
0
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...
0
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...
0
isladogs
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...
1
isladogs
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...
0
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...
1
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)...
0
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...
0
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
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.