473,327 Members | 2,007 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,327 software developers and data experts.

Unbound TextBox assignment to a Record OnClose

I have a Single form with its RecordSource set to one table.
This form will have only one record that is used for the application
setup.

I have UnBound TextBoxes on the form. The textboxes will get filled,
and I want to have this data saved to the single record of the Table
using the OnClosed event.

The problem is that I get the error "You can't assign a value to this
object". The code below works fine when placed under a button. I
have the impression that the OnClose event may be too late for the
value assignment? How do I make the assignment??? Can this be done
without making DAO references?

Private Sub Form_Close()
Me.FIELD1 = EncryptDecrypt(Me.txtBox1)
Me.FIELD2 = EncryptDecrypt(Me.txtBox2)
End Sub

Mar 9 '07 #1
2 1741
I also tried the OnUnload event and this seems to work. The data goes
to the Table, but when I switch over to design view, the same error
message is showing with the code highlighted in the OnUnload event???

Mar 9 '07 #2
On Mar 9, 3:06 pm, "ApexD...@gmail.com" <ApexD...@gmail.comwrote:
I also tried the OnUnload event and this seems to work. The data goes
to the Table, but when I switch over to design view, the same error
message is showing with the code highlighted in the OnUnload event???
If you're intention is to display an encrypted field, then I would
make the changes to the bound fields when the unbound ones change.
In the AfterUpdate of the txtbox controls

Me!BoundControl = EncryptDecrypt(Me.txtBoxX)

Make the bound ones hidden.
When the record is updated, the bound controls already have their
needed values. No need to do it when the form closes.

Likewise, when you load the record set the value of the unbound
controls based on the bound ones.

Mar 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pat | last post by:
Hello, I've used Sum() to total bound fields on a continuous form with no problem. However, I now have a continuous form, on which I use an unbound field to calculate the number of hours between...
2
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS...
20
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of...
10
by: Matthew Wells | last post by:
Hello. I've converted a bound Access 2000 form which displays data retrieved from an Access 2000 database to an unbound form. Now my hyperlinks don't work. I'm assuming it's because the form...
1
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform....
11
by: TD | last post by:
I'm looking for input into my decision to switch to ADO and unbound forms. I get tired of having to block all of the ways a user can unknowingly save a record, like using the PageUp, PageDown keys...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
4
by: =?Utf-8?B?am9obmI=?= | last post by:
Hi All I have a 2005vb.net Form with 2 datagrids with a perent child relationship. On the child datagrid I have 2 unbound columns which are derived from other columns in the grid. And it works...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.