473,797 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Continuous Forms Question

34 New Member
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 1316
Rabbit
12,516 Recognized Expert Moderator MVP
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 New Member
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 Recognized Expert Moderator MVP
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
2210
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 set to Continuous Forms, I need to catch the event when the repeating section iterates for each record in the underlying table. I have buttons on the repeating section which will get their captions from the current line in the table, or which will...
3
6670
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 & "", "" & AS Student, activities.activityDescription, studentScores.score FROM groups INNER JOIN (students INNER JOIN (activities INNER JOIN studentScores ON
11
3567
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 for each field I need to display. The creating a controls array for the first n records I show and populate the text boxes. Then setting up a vertical scroll bar for the number of records in the data table. As the scroll bar is clicked or dragged,...
4
4461
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 New Record" button. Here's my question. I want to get rid of that last empty line. The one where when I start adding a new record, Access automatically drops in a last blank to type in. The reason is that when someone clicks "Add New...
9
6769
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 second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
2
2406
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) and use this to populate the AssetID textbox of another form. Any ideas on how to link these? Thanks! Bhavesh
5
27599
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 and select the first color. .ControlSouce =fRowNum(False) .Name = RowNum 2nd step: Add the following function to the form module: (for row numbers) Public Function fRowNum(Reset As Boolean) As Long Static I As Integer
1
10926
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 record in the recordset. I can have the pictures converted to any usable format, use OLE or linking, whatever needs to be done. So far, the 3 possible solutions I have found are: 1) OLE objects - if you don't have bitmaps associated just...
5
10595
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 click/double-click in a row's detail section doesn't generate the relevant click event UNLESS that row is already the current row (that is, the Record Selector symbol is showing at the left end of the row). So I guess my thought was wrong. Of...
1
3252
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 Member is seen as a row in a continuous form like:
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.