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

Problem with Databound textboxes

126 100+
Hello everyone,

I created an Access VBA form, which contains a date textbox and a calendar image. The textbox is bounded to "Date" field of "UserProfile" Table.

Whenever a user clicks the calendar image, a popup calendar will be opened and the user can choose date to enter it in the focused textbox.

But, I want to enter the chosen date in all the bounded date textboxes present in the form instead of only in the focused textbox.

Please kindly let me know how to solve this issue.

Thanks in advance.
Nov 12 '08 #1
5 1458
Hi

How about using the 'on updated' event of the calendar control? i.e.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Calendar_Updated(Code As Integer)
  2. text box 1 = me.calendar
  3. text box 2 = me.calendar
  4. 'and so on, using the correct names for your controls
  5. End Sub
Kevin
Nov 12 '08 #2
FishVal
2,653 Expert 2GB
Hello.

Take look at Forms Interaction howto.

Regards,
Fish
Nov 12 '08 #3
missinglinq
3,532 Expert 2GB
I think we need to clarify one point before we get off on the wrong tangent here! Is Kevin correct in assuming that by

I want to enter the chosen date in all the bounded date textboxes present in the form instead of only in the focused textbox.
you mean that you have a number of different textboxes in the current ***record*** all of which you want to set to this selected date?

Or do you mean that you want the selected date to populate the same textbox on all of the records in your form?

Linq ;0)<
Nov 13 '08 #4
JFKJr
126 100+
Hello missinglinq,

Thanks for the reply.

I want the selected date to populate in the same textbox on all of the records in my form.

Please let me know how to solve this issue.

Thanks a million.
Nov 13 '08 #5
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2. Dim SQL As String
  3. SQL = "UPDATE userProfile" & _
  4.           "SET userProfile.Date= '" & me.calendar & "'
  5. 'MsgBox SQL
  6. DoCmd.RunSQL SQL
  7. DoCmd.SetWarnings True
In theory that should update all instances of the 'Date' field from the table 'UserProfile' to the value selected on the selected forms calendar control (named 'calendar').
The MsgBox is a debug thing I do; comment out the RunSQL line and uncomment MsgBox to get a popup box containing the SQL.
PLEASE copy or backup the table before running this as I haven't tested it, I've just copied and modified.
Also if you need it to be only certain ones add a WHERE at the end.

Oh, and comment out the first line "SetWarnings False", and you'll get a message saying how many records will be updated and asking if you want to continue. It's a good idea to do this to make sure you're getting the number you think you should be.
Nov 14 '08 #6

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

Similar topics

4
by: Jeti [work] | last post by:
I have tab control with several tab pages. Each tab page contains a few textboxes filled dynamicly from the code. Everything goes fine, but every textbox that is located on a tab page that has hot...
2
by: Jon S via DotNetMonster.com | last post by:
Hi all I'm new to C# and ADO.Net. I've managed to insert, update and delete records from a database but I need to know how to show these changes immediately. For example : If I delete a record...
3
by: Jan Nielsen | last post by:
Hi I have a form with a combo on it The combos items is a list of groups (ie coworker, parent, friend) which it gets from a dataset when the form loads. When the user selects a group from the...
10
by: B. Chernick | last post by:
I am using a System.Web.UI.WebControls.Table control on a screen. (Dot Net 1.1) My problem is this: The table is programmatically reconstructed on every postback. Each table row contains two...
0
by: Michael | last post by:
Hello, I have a windows app I'm writing in C#. It is connected to a MS Access database. The Database has two tables, User table and UserRights table. They are related on UserID. Now in the app,...
3
by: Dustin Davis | last post by:
Setting up databindings for controls like textboxes and checkboxes is pretty straightforward, but how do you set up a databound radio group? For example, say I have source_type in my database...
2
by: janders468 | last post by:
Is it possible to hide the new row record in a databound form? For instance if I have textboxes representing the records of an underlying table can I suppress the bottom row of blank textboxes?
1
by: kitemad69 | last post by:
If i insert more than 9 digits into my databound textbox. I am unable to tab to the next textbox the column that the textboxe is linked to is a INT32. Please any suggestions. The maxlength in the...
5
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Formview controls In a ASP.Net form I have 20 textboxes and 20 dropdownlists(ddl). All ddl(s) are databound and get...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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,...
0
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,...

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.