My Assistant
![]() ![]() |
|
|
Nov 29 2007, 12:40 PM
Post
#1
|
|
|
New Member Posts: 4 |
I am trying to have a button created that when it is cllicked on the form, three fields associated within the record source for that form are emptied or created as null, basically to override a previous value so that those fields in the form are empty.
How can I use a button to make three fields that are attached to a table through the form, empty? Can someone help pls. |
|
|
|
Nov 29 2007, 01:09 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 972 From: Indianapolis, IN (between Terre Haute & Muncie) |
Welcome to UtterAccess!!!!!
If your table is bound to the form, and you are looking at the current record, what you need is pretty simple: CODE private sub cmdDelete_Click() me.field1=null me.field2=null me.field3=null end sub This would have the same effect if the user entered the field and deleted the data. There are a zillion variations to this that can be applied or considered. Here are a few: 1. Do you want to stop and ask the user "Are you sure?" 2. Is the data we're deleting NOT bound in our current form? 3. Are the target fields set to not allow nulls? I hope this helps. - Sligo |
|
|
|
Nov 29 2007, 01:22 PM
Post
#3
|
|
|
New Member Posts: 4 |
thx. This will only delete the value in that record only for those fields and not all records for those fields in the table?
|
|
|
|
Nov 29 2007, 01:30 PM
Post
#4
|
|
|
New Member Posts: 4 |
when I did this, it said the following
'You Can't Assign a Value to this object' this is what I put in the code of the button on the form Private Sub cmdOverride_Click() Dim stDocName As String Me.strSig = Null Me.strStmt = Null Me.blnDone = False stDocName = "frmStart" DoCmd.Close DoCmd.OpenForm stDocName End Sub |
|
|
|
Nov 29 2007, 02:04 PM
Post
#5
|
|
|
New Member Posts: 4 |
nevermind. I think I got it. thx again!
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 08:30 AM |