473,699 Members | 2,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set a textbox value in VB when the report loads?

88 New Member
Hello,

Is it possible to set the value of a textbox on a report in VB when the report loads?

Any ideas?
May 21 '07 #1
5 23883
fperri
88 New Member
I figured out how to refrence it but I'm getting an error now that the property is read only and cannot be set. Any ideas what I'm doing wrong?

Thanks :)
May 21 '07 #2
puppydogbuddy
1,923 Recognized Expert Top Contributor
I figured out how to refrence it but I'm getting an error now that the property is read only and cannot be set. Any ideas what I'm doing wrong?

Thanks :)
You did not post your code, but it should look something like this:

Private Sub Report_Open(Can cel As Integer)
Me!YourTextboxN ame.Value = 5000
End Sub
May 21 '07 #3
fperri
88 New Member
Sorry, I got this from an example online, but I get the read only error on the value property.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. Dim rst As DAO.Recordset
  3. Dim db As DAO.Database
  4. Dim i As Integer
  5. Dim j As Integer
  6. Set db = CurrentDb
  7. Set rst = db.OpenRecordset("select * from pivotRates")
  8. rst.MoveFirst
  9. j = -1
  10. i = 0
  11. For i = 0 To rst.Fields.Count - 1
  12. If rst.Fields(i).Name Like "*ID" Then GoTo skip_it
  13. j = j + 1
  14. Select Case j
  15.         Case 0
  16.             Me.txtLender1.Properties(Value) = rst.Fields(i).Name
  17.         Case 1
  18.             Me.txtLender2.Properties(Value) = rst.Fields(i).Name
  19.         Case 2
  20.             Me.txtLender3.Properties(Value) = rst.Fields(i).Name
  21.  
  22. End Select
  23. skip_it:
  24. Next
  25. rst.Close
  26. Set rst = Nothing
  27. End Sub
  28.  
May 21 '07 #4
fperri
88 New Member
Ok, I found this help article on Microsoft's website.

http://support.microso ft.com/kb/328320

This worked. :)
May 21 '07 #5
puppydogbuddy
1,923 Recognized Expert Top Contributor
Ok, I found this help article on Microsoft's website.

http://support.microso ft.com/kb/328320

This worked. :)
So, your problem is resolved? Just so you know, you were getting the "read only" message in your previous post because the code was only executing a select statement against the recordset....th e recordset was never put in .Edit mode and updated.
May 21 '07 #6

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

Similar topics

1
1426
by: moid | last post by:
im not able to get textbox value from the datagrid that is in the usercontrol. usercontrol is created dynamically on the page. i want to delete some values if textbox in the datagrid is 0 Please Help Regards, Moid Iqbal
1
2375
by: Pieter | last post by:
Hi, Is there a way to link the Hidden-property of a Textbox on a Reporting Services Report to it's Value? When the Value is empty (""), then I want the TextBox be Hidden. In case you don't ide the Textbox, there is still white space taken. Now I have to check in every Hidden-property of the Value of my datasource is empty or not, but I woudl like to have some general expression that I can
1
3465
by: viral123 | last post by:
Hi all I am using Crystal report and I am running my report successfully for my query but I want to make my query for one specific date. I want to get the date value from the textbox value. My query small example is as follow: Select name from employee where date_of_birth = '01/01/1984'
1
3859
by: danielgoss | last post by:
Hi I have a report that has loads of textboxes that calculate things based on the value on another textbox in the report. I have put a hidden textbox on my report that gets its value from an inputbox when the report opens. I then want to use the value inputted in a DSUM calculation on the same form. The hidden textbox is called tbHolddate, its control source is: =InputBox() The textbox that calculates a value using a DSUM control...
2
4717
by: g7murali123 | last post by:
hi, my textbox contains text as "search" on pageload when the user click the textbox the text "search" should disappear and the textbox must get the value of the user entering text. please help the guide for this event in asp.net c#
0
1435
by: discussion | last post by:
Hello, I am doing a small project in VB6 using MSAccess as database can someone guide me how to --- I have a form which ask user to enter value for two text boxes FROMDATE and TODATE . and form has 1 command button GENERATE REPORT. how can i pass the value of FROMDATE and TODATE on report. so the statement on report will say This report is From date (FROMDATE) To date (TODATE). Thanks
3
1626
NawazAhmed
by: NawazAhmed | last post by:
Hi, I am working with Visual Studio 2003, framework 1.1 I am trying to focus a textbox when page loads. I tried Page.RegisterStartupScript("focus", "<script>document.getElementById('name').focus();</script>") and textbox.focus() and textbox.setfocus()
10
21556
by: pt36 | last post by:
Hi I have a page with a form and a textbox. before to submit the form I want to chek if the inserted value in the textbox is already present in a database. So I need to pass the textbox value by a javascript link to another page to check. my code is <a href="javascript:location.href='page_check.php' "Go check </a> and this work and open page_check.php
3
1967
by: xraive | last post by:
Currently I am able to use a texbox to search through the listbox only when the multiselect property is set to none. But when I change the property to simple or extended my function doesn't work. Please see below Function Public Function CheckListbox(strPass As String, lstPersons As ListBox) Dim intCurrIndex As Integer Dim intStringLen As Integer
0
8704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
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
9192
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
9054
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
8940
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
7781
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4390
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
3071
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
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.