473,493 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Refresh a specific subform

1 New Member
I am trying to create a digital board with configuable columns, if the columns are too long, I want to scroll them one at a time and refresh that column. Each column is displayed in its own sub-form. I have a table with various information about the column including the subform name (or what I believe is the subform name) as a string. I can refresh the form and all subforms, but I want to only refresh the subform which has changed due to a scroll of the data
The trial code I have is :
Expand|Select|Wrap|Line Numbers
  1. Dim frmname As String
  2.  Dim dbdatabase2 As DAO.Database
  3.  Set dbdatabase2 = CurrentDb
  4.  Set rs = dbdatabase2.OpenRecordset("BoardInfo")
  5.  Do While bigcnt < 3 'while in test mode just do three loops
  6.  rs.MoveFirst
  7.  Do While Not rs.EOF
  8.    If rs("datalen").Value < rs("collen").Value Then GoTo notneeded ' ie if no need to scroll skip the nxt bit
  9.    Cnt = ScrollData(rs("TableData").Value, rs("Subformdata").Value, rs("Collen").Value, rs("begin").Value) 
  10.     'my scroll routine which updates the column data returns the record number of the first record in the column
  11.    rs.Edit
  12.    rs("begin").Value = Cnt 'keep a track of the start of the scroll
  13.    rs.Update
  14.    frmname = rs("Subformname").Value 'get the subform name from the table
  15.    Forms!HonourBoard.mychildformname.Form(frmname).Refresh  'refresh the specific subform (this causes an error)
  16.    Pause (5)
  17. notneeded:
  18.    rs.MoveNext
  19.  Loop
I am sure the issue is just one of syntax, so if anyone can assist I would be very greatful.
Dec 9 '22 #1
1 7163
NeoPa
32,556 Recognized Expert Moderator MVP
Hi there. Welcome to Bytes.com.

Let me start with a quick link to an article that explains subform referencing (Referring to Items on a Sub-Form).

Hopefully from there you can adjust your own code. It looks like you're pretty close already TBF. If not then let us know & we'll go into it more closely for you.

You don't show the header or footer of the subroutine so we're missing vital information, but if the code is in the module of the main form then you can replace some of the reference with the Me keyword. I expect changes are required for line #15.
Dec 9 '22 #2

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

Similar topics

1
1707
by: teddyparnell | last post by:
I have a query that works, but then displays the results in a datasheet view. The query is reliant on the results of a combo box, and when i update this combo box and click a button the results of...
1
1384
by: solar | last post by:
In the table underlying the subform i have added a name to the caption.Now when i make a query the field appears with the name of the caption.However, in the subform, this change appears not to be...
4
12928
by: Wilkesy | last post by:
Hi all, This is really begining to do my head in!!! I have a query that im trying to run, but i want it to refresh a subform, not open up into a new window. I have a CD database and so far i...
3
1916
by: panwala_bhavesh | last post by:
I have a subform in continuous form style that I use to populate 3 fields (textboxes) on my main form with a double-click of the key-field textbox of the sub: Private Sub...
14
4016
by: Rational Repairs | last post by:
I am trying to create global code for navigation use in all my forms -- including subforms. I searched, and searched, but can not find how to globally reference a subform object. I need to have the...
1
1340
by: Lori2836 via AccessMonster.com | last post by:
Can someone help. I'm afraid I'm not too good at Access. What I'm trying to do is create a main form with a subform. The subform is "Search by Item Desc", which the record source is a query...
6
3525
by: Chris Larmer | last post by:
I have two subforms in my main form. In the main form I want the user to select a customer, class, and date range. The 2 subforms are similar. One is the history records in the recent past and the...
3
4037
by: jondays | last post by:
Hello, I hope you can help me out... Ok so here is the setup, I have a form which contains a subform. The subform seems to refresh multiple times without having the click on anything. If I...
5
3309
by: bplantes | last post by:
I have a "Dashboard" in a tool I am building which has a list of different buttons. Clicking on each button will display different subforms which show up in a window to the right of the menu. One...
0
915
by: Ruchval | last post by:
Hello again, I have a table Operations OpeCompID * OpeSectID * OpeJobID * OpeOperID * OpeName
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6989
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...
0
7195
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...
1
6873
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...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
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 ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
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...

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.