Keep getting this massage, "Compile Error: Argument Not Optional" and highlighted Me.txtSiteType
Trying to figure up, but failed.
Please help. -
Private Sub cmdAdd_Click()
-
'when we click on button add there are 2 option
-
'1. for insert
-
'2. for update
-
If Me.txtSiteID.Tag & "" = "" Then
-
'this is for insert new
-
'Add data to table
-
CurrentDb.Execute = "INSERT INTO contoh(Site ID, Site Name, Site Type) " & _
-
" VALUES('" & Me.txtSiteID & "','" & Me.txtSiteName & "','" & Me.txtSiteType & "') "
-
Set Data = cmdAdd_Click()
-
MsgBox "Already Add"
-
-
-
End If
-
End Sub
-
-
Thanks in advance,
Remove the equals sign after the CurrentDb.Execute. Also, I believe that you need square brackets around your field names because of the spaces.
6 2056
Try putting a space between your table name and the opening parenthesis as well as after the word VALUES.
Done, still got the same massage.
Remove the equals sign after the CurrentDb.Execute. Also, I believe that you need square brackets around your field names because of the spaces.
OMG!, Thanks Seth Schrock. Will get nightmare because of both square bracket and "=" only.
Glad it worked. I missed it the first time as well.
NeoPa 32,556
Expert Mod 16PB
Amira.
Some tips that may prove helpful : - As a general rule it is good practice to prepare your SQL in a string variable first. That way you can show the contents of the string as well as use as one of the parameters to your procedure or method. See How to Debug SQL String.
- Never use the result of the
CurrentDb() function call directly. Always assign it once to a variable and then use the variable for all future references. CurrentDb() is a function that actually returns a different value each time it's run - even though each value represents the same database object. - When referencing procedures, either subroutines or functions, it makes it easier to read your code if you use the
Call syntax. EG. The syntax for Execute would be like : - Call dbVar.Execute(Parameter#1, Parameter#2, etc)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dom |
last post by:
Does anybody have these programs:
Direct I/O - full version, licence key, key generator, crack...
anything!
Multimedia Tools 2.0 for VB6 - full version or crack (I found only crack
for delphi...
|
by: Ragnorack67 |
last post by:
Hi, is it possible to change a form text field to this.blur() from a
separate function? So, what I want to do is when a button is click it
will runblur(), and cause form input name "xyz" to go...
|
by: greenflame |
last post by:
I need code to compute the determinant and inverse of a matrix. for
example the determinant and inverse of:
|
by: johnb41 |
last post by:
I am building a .net app that does some simple image tasks (Tiff
files): viewing Tiff, viewing thumbnails from multipage tiff,
rotation, page (frame) deletion, etc.
The problem is that it is so...
|
by: sdavies6 |
last post by:
I have no idea how this got onto my month old HP computer; I must have
downloaded something which uses it. It seems I have a folder and subfolders
equaling about 29 MB, called PYTHON 22. The...
|
by: smerf |
last post by:
Watch the first video about this Delphi error reporting tool. This is
great!
http://www.madshi.net/madExceptVideos.htm
Does anyone know of anything similar for .Net?
|
by: nkotbox |
last post by:
I have this script to enable/disable my wireless nic on my laptop. Is it possible for the scripts icon or shortcut to the script to change icons depending on whether or not the nic is enabled. So if...
|
by: Debby Dadebo |
last post by:
Hello,
Please I need a program code that will convert roman numerals to integers. I will be glad if you can add the programs algorithm and flowchart. Thanks and God Bless you
|
by: CranberryPunch |
last post by:
{block:HasTags}
{block:Tags}
<font size="2">
<font color="#FFFFFF">
<a href="{TagURL}">{Tag}</a>
</font>
</font>
{/block:Tags}...
|
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: 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: 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,...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |