473,378 Members | 1,236 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,378 software developers and data experts.

Set a textbox value in VB when the report loads?

88
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 23859
fperri
88
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 Expert 1GB
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(Cancel As Integer)
Me!YourTextboxName.Value = 5000
End Sub
May 21 '07 #3
fperri
88
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
Ok, I found this help article on Microsoft's website.

http://support.microsoft.com/kb/328320

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

http://support.microsoft.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....the 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
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 ...
1
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...
1
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. ...
1
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...
2
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...
0
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...
3
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",...
10
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...
3
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. ...
1
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.