Hello,
I'm trying to work the bugs out of my app. At compile time I get an error (grey bar covering the 'mysql')when I put the following code in: - Private Sub cmdErasePic_Click()
-
If Not IsNull([imageFile]) Then
-
If MsgBox("This image will be permanantly removed, Are you sure?", vbYesNo + vbQuestion) = vbYes Then
-
Me!frmimagesubform.Form![imgPicture].Picture = ""
-
Me![imageFile] = Null
-
SysCmd acSysCmdClearStatus
-
DoCmd.SetWarnings False
-
Dim strSQL As String
-
'DELETES the Current Record
-
mysql = "DELETE * FROM imageInventory Where imageInventory.[imageID] = " & Me![imageID]
-
DoCmd.strSQL mysql
-
'Move the Record Pointer IN some manner
-
DoCmd.SetWarnings True
-
Call Form_Current
-
End If
-
End If
-
End Sub
thanks in advance
5 1362
I've moved your question to the Access forum, so all experts can have a look.
I'm a bit puzzled why you use "mysql", while you define;
dim strSQL
Both won't be needed when you use:
currentdb.execute ("delete * from X where ID=" & myID)
Nic;o)
I've moved your question to the Access forum, so all experts can have a look.
I'm a bit puzzled why you use "mysql", while you define;
dim strSQL
Both won't be needed when you use:
currentdb.execute ("delete * from X where ID=" & myID)
Nic;o)
Someone gave this me and I followed it. I'm a newbie. Sorry, what should it be? thanks
NeoPa 32,556
Expert Mod 16PB
Someone gave this me and I followed it. I'm a newbie. Sorry, what should it be? thanks
Rosie, try to bit a bit more specific showing which error message you got and on which line of the code (by number).
Rosie, try to bit a bit more specific showing which error message you got and on which line of the code (by number).
Thanks for your response NeoPa....I finally got it working with help from thescripts, of course. Here's the code that works but has one more issue stated beneath: - Private Sub cmdErasePic_Click()
-
If Not IsNull([imageFile]) Then
-
If MsgBox("This image will be permanantly removed, Are you sure?", vbYesNo + vbQuestion) = vbYes Then
-
Me!frmimagesubform.Form![imgPicture].Picture = ""
-
Me![imageFile] = Null
-
SysCmd acSysCmdClearStatus
-
DoCmd.SetWarnings False
-
Dim mysql As String 'Declare the Variable by assigning SQL String to the variable mysql
-
mysql = "DELETE * FROM imageInventory Where imageInventory.imageID = " & Me![imageID]
-
'Execute the SQL Statement is next
-
DoCmd.RunSQL mysql
-
DoCmd.SetWarnings True
-
Call Form_Current
-
End If
-
End If
-
End Sub
The other issue is that once the delete occurs, immediately the message #Deleted, pops up in each of the form controls. It causes a problem when (on same form) a user clicks the 'next' control or 'previous'...They get a msg saying 'Type mismatch' error. This error goes away after you close form and reopen (which apparently gets rid of the table deletes, so no error). I've tried using Me.Refresh immediately after the delete in the code, but it doesn't clear it out immediately, I still have to close form and re-open. Any ideas?
NeoPa 32,556
Expert Mod 16PB
.Refresh won't do it for you. You need .Requery.
The former merely updates the data in records that already were included in your recordset.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ola Ogunneye |
last post by:
--=_7B255FAE.1F7E0C30
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Hello all,
Let me start out by saying that I am still a newbie. I just freshly
installed...
|
by: Jeff D. Hamann |
last post by:
I've asked this question on the emacs newsgroup and didn;t get an answer, so
I thought I might post the question here.
I've been using emacs sql-mode for some time now (with MySQL) and love it....
|
by: Jeff S |
last post by:
To make a long story short, let me say I had MySQL working on Windows 98
and everything was fine. Well, I took the big leap and removed all
traces of Windows and Microsoft from the computer....
|
by: el chupacabra |
last post by:
I'm using mysqldb module and python 2.4. I'm a newbie. Thanks in advance.
1. Output desired:
"hello"
"world"
I know that MySQL takes \n and \t and what not.
But my python script, it...
|
by: Sai Hertz And Control Systems |
last post by:
Dear all,
Their was a huge rore about MySQL recently for something in java functions
now theirs one more
http://www.mysql.com/doc/en/News-5.0.x.html
Does this concern anyone.
What I...
|
by: apostolosl |
last post by:
Hi there.
I need to update a remote database from a local one. I use mysqldump in
my php page in order to create a file for each table, like this:
$command="mysqldump table_products >...
|
by: Gabriel Genellina |
last post by:
En Sun, 21 Sep 2008 19:42:10 -0300, Blubaugh, David A.
<dblubaugh@belcan.comescribió:
Below there is a transcript of a compile session. I've used a somewhat old
version of mingw and g77, scipy...
|
by: jim190 |
last post by:
I am relatively new to using VBA and am have been trying for two days to pass a user entered value to my report for filtering when opened. I have the following subroutine in the open event of my...
|
by: sganeshsvk |
last post by:
i want to clear the screen command prompt for mysql in windows XP...
In linux we use (CTRL + L) for clear the screen in mysql prompt....
i already use this command ( \c ) then ( \! clear ) for...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |