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

First Access Database from Scratch

I need for a check box when checked to verify whether a textbox has a certain value in it's field, and if it doesn't, it needs to create a MsgBox telling the user that they must enter an amount in that field. This is my code:

Expand|Select|Wrap|Line Numbers
  1. Public Function VerifyAmount()
  2. Dim amount As Currency
  3. amount = txtOpenBalance
  4. If amount = 0 Then
  5.     MsgBox("Please Enter an Amount for the Open Balance", vbOKOnly, "Error") = vbOK
  6.     txtOpenBalance.focus = True
  7. End If
  8. End Function
  9.  
  10. Private Sub chkComplete_Click()
  11. VerifyAmount() = vbOK
  12. End Sub
The problem is that on the line where i create the msgbox it gives me an error saying "Compile Error: Function call on left-hand side of the assignment must return Variant or Object"

How can I fix this?
Mar 21 '08 #1
1 1104
Scott Price
1,384 Expert 1GB
You are trying to set the response before the response, if you understand what I'm saying :-)

A message box returns a value, but in your code you are trying to SET it's value equal to OK. Remove the = vbOK and you should be fine.

Regards,
Scott
Mar 21 '08 #2

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

Similar topics

3
by: Clive Minnican | last post by:
Hi there, I have written an application which uses MS Access for it's database engine. Due to the large size which the database has become I have decided that it would be sensible to use SQL...
3
by: John Fine | last post by:
I wrote a Delphi application that accesses a local Access database using 2 instances of the TADOQuery class. Unfortunately, when I traverse the DB records using the first TADOQuery instance, the...
2
by: John C | last post by:
I am trying to develop a access database version 2002 from scratch and I am a novice programmer and need much direction. I have been researching and studying about relational database design and...
33
by: Uwe Range | last post by:
Hi to all! A customer of mine told me some days ago that her IT-people told her ACCESS would not be such a good idea for continuing with our project, because Access will not be continued in the...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
6
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
6
by: LurfysMa | last post by:
I am working on an electronic flashcard application. I have one version up and running using Visual Basic (6.0) and Access 2000. My long-range plans are to put it up on a website and sell...
2
by: raylopez99 | last post by:
I am trying to program a database from inside C++.NET via Visual Studio 2005 using the ADO.NET set of classes, but this I believe is a SQL Server 2005 Express permissions question under Windows XP...
15
by: chaseexchange | last post by:
First, a brief explanation of why this has happened. I purchased, what I thought, was a fully functional program written in Access last year from a local programmer. This program was to be used as...
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
tracyyun
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...
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,...
0
isladogs
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 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.