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

Need message for fields that are returned with no value!

Hi!

I've designed a query.
I've now created a form for the results of this query to be displayed.

I'm able to view the results for what information is in the Db, however if I should input StockId as '1234' which is NOT in the current Database when I input that "1234" the field is returned Blank.

e.g. [Enter StockId] I enter '1234' but since that is not a value in StockId the field is returned blank (form remains blank)

I now wish to have a message advising the user that there is no such value in the database.

I've tried using the MsgBox on the form's Error event but no such luck.

Thanks again.
Aug 12 '09 #1
8 1229
ChipR
1,287 Expert 1GB
When you say "input" that StockID, how are you doing it? Possibly a combo box in the form header?
Aug 12 '09 #2
Oh Thanks again ChipR for always responding!

When I refer to input, it's a query that I've used so it's the [Enter StockId] criteria that I refer to.

e.g. A customer comes in and request a certain Stock....Let's say instead of StockId I use StockName as that criteria there......

I desire to now have a message if I type "Charla" as the item requested and there is no such item.

I'm not always clear.....but I hope you somewhat understand.

Thanks again :-)
Aug 12 '09 #3
ChipR
1,287 Expert 1GB
Oh I see what you mean. You want to filter the query results on your form, right? Here's how I would do it. Create a form where the user can enter search criteria before you show the form with the records. For example, your form has a txtStockID where the user enters the number they want to search for. You can expand this code to check more than one box. Then just open a form that shows your whole recordset, but filter it using the criteria.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSearchButton_Click()
  2. Dim intMatches As Integer
  3. Dim strWhereCondition As String
  4.     intMatches = DCount("StockID", "myQuery", "[StockID] = " & txtStockID)
  5.     If intMatches > 0 Then
  6.         strWhereCondition = "[StockID] = " & txtStockID
  7.         DoCmd.OpenForm "frmViewRecords", , , strWhereCondition
  8.     Else
  9.         MsgBox "No records found with that Stock ID Number"
  10.     End If
  11. End Sub
Aug 12 '09 #4
ChipR
1,287 Expert 1GB
This is a lot like making your own prompt to enter parameters, because the built in one is pretty inflexible.
Aug 12 '09 #5
Ok. Thanks again ChipR.
I will try it.
Thanks ever so much.
Aug 13 '09 #6
Hey ChipR. Thanks ever so much, it worked Fantastic!
Aug 13 '09 #7
ChipR
1,287 Expert 1GB
Glad to hear it. You're catching on quickly.
Aug 13 '09 #8
Well that's because you're doing a gr8 job at explaining! Thanks.
Aug 13 '09 #9

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

Similar topics

2
by: Quinn | last post by:
HI! Have two from text fields named "odds" and "stake" where I enter numeric values. I want to have a text label named "returns" that is automatically updated whenever any of these changes. ...
8
by: Bill | last post by:
Hello out there; This may be a challenge but I'm certain it's possible but I can't seem to figure out how. I have a table that has several date fields, e.g., Date1, Date2, Date3, Date4 ......
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
9
by: MrHelpMe | last post by:
Hello again experts, I have successfully pulled data from an LDAP server and now what I want to do is drop the data into a database table. The following is my code that will insert the data but...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
4
by: pbd22 | last post by:
Hi. In my script the below code creates a new element on the page with an associated delete button: var row_element = new Element( 'div', { 'class':'container', 'events':{
6
by: dang57 | last post by:
I had written a vb.net app for clients that wanted to use a datagrid like a spreadsheet. Rather than edit one line at a time, they wanted all lines available at all times. That seemed to work...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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.