473,796 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Smart Defaults

Can anyone say what is wrong with this please:
Private Sub Combo18_AfterUp date()
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT [Height Pixels] FROM [Pictures]WHERE
[Pictures].[Height Pixels] IS NOT NULL AND [Width Pixels]= '" & Me![Combo18]
& "';"
Me![Height Pixels].RowSource = SQLStmt
Me![Height Pixels].Requery
Set R = CurrentDb.OpenR ecordset(SQLStm t)
If R.RecordCount > 0 Then
R.MoveLast
If R.RecordCount = 1 Then
Me![Height Pixels] = R![Height Pixels]
End If
End If
End Sub

Control Source for Combo18 is Width Pixels. The idea is a “smart” default
for Height Pixels field, but I just get “Run-time error 438”

Thanks

Peter

Nov 12 '05 #1
1 1525
Maybe I misunderstand, but wouldn't both HeightPixels and WidthPixels be
numeric? You are enclosing the value for WidthPixels in quotes as though it
were a string.

It also appears that you are never setting the value of HeightPixels if more
than one record was returned. Try indenting your code as a reminder to
yourself.

Since you set its RowSource, I assume that the HeightPixels to which you
refer is a Combo or List Box. Could it be that it has the same name as the
Field to which it is bound? A Field, of course, does not have a RowSource.

All of the above are just observations... not related to the error you
experienced. In regards to which, so people don't have to go look up the
description of an error*, it's good to include it. It is also useful to
indicate on which line of the procedure the error occurred. Remote debugging
is difficult at best, but without all the information, it is impossible.

* most, like me, just won't take the time to do so
unless they find the problem very intriguing

Larry Linson
Microsoft Access MVP
"Peter Barker" <pe***@exeter.f lyer.co.uk> wrote in message
news:vq******** ****@corp.super news.com...
Can anyone say what is wrong with this please:
Private Sub Combo18_AfterUp date()
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT [Height Pixels] FROM [Pictures]WHERE
[Pictures].[Height Pixels] IS NOT NULL AND [Width Pixels]= '" & Me![Combo18] & "';"
Me![Height Pixels].RowSource = SQLStmt
Me![Height Pixels].Requery
Set R = CurrentDb.OpenR ecordset(SQLStm t)
If R.RecordCount > 0 Then
R.MoveLast
If R.RecordCount = 1 Then
Me![Height Pixels] = R![Height Pixels]
End If
End If
End Sub

Control Source for Combo18 is Width Pixels. The idea is a "smart" default for Height Pixels field, but I just get "Run-time error 438"

Thanks

Peter

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1361
by: BryanEverly | last post by:
Hi, I'm struggling with a problem and was hoping that someone on this group could point me in the right direction. I'm not looking for a free ride, just a suggestion as to how best to use all the tools at my disposal to diagnose the situation. I have an existing COM+ / ASP application (the COM+ objects are written in VB 6.0) that I am wanting to migrate forward to .NET (using VB.Net). I have added some ASPX pages to the existing...
11
7045
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and aren't very computer savvy. I created a system where they can save their Word documents as "html" and upload them to a certain directory, and the web page dynamically runs them through tidylib using the tidy extension to php4, thus causing the...
10
6976
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/63cce060ff152dcc/1dc13d4ee6758966?lnk=st&q=difference+constraint+sql+defaults&rnum=14#1dc13d4ee6758966 I read SQL Server MVP Louis Davidson's post saying: "Actually they are more likely to drop the concept of bound defaults. Constraints are the standard way to do...
8
2330
by: btober | last post by:
I'm finding that column defaults are not being assigned to nulls when I do an insert by way of a an ON INSERT rule on a view. For example, the following script \set ON_ERROR_STOP ON \c template1 --DROP DATABASE testdb; CREATE DATABASE testdb; \c testdb
7
22246
by: Jeff | last post by:
Out of curiosity, I tried to check the help file for the property 'Fetch Defaults' to see what it is for. No surprise, it is not mentioned. F1 on the property give nothing. A search of MS knowledge base is equally unhelpful. Can anyone explain what this new property in 2003 is for? Jeff
1
1645
by: Bill Menees | last post by:
VS.NET 2003 defaults the "Debugger Type" property to "Auto" for Visual C++ projects. Unfortunately, the "Auto" type isn't very smart. "Auto" bases the debugger type on the launched EXE's type, which may have nothing to do with the C++ project I'm trying to debug. I have a .NET EXE that hosts all of my DLLs, but a lot of the DLLs are old, unmanaged C++ COM DLLs. Now everytime I debug one of them, I have to remember to change the...
8
5156
by: Axter | last post by:
I normally use a program call Doxygen to document my source code.(http://www.stack.nl/~dimitri/doxygen) This method works great for small and medium size projects, and you can get good documentation like the following: http://axter.com/smartptr Now I'm on a client site, and I'm trying to create the same type of documentation on a very large project. I ran the Doxygen program, and it ran for over 16 hours, before I had
2
2048
by: stefan | last post by:
Hi, for a school project I'm trying to analyze some python modules. I just struggeld over a little detail I cannot solve: shortened example of walking trough an AST with my own visitor: class MyVisitor: def visitFunction(self, t): # Here I do not know know how to associate the default values
92
5132
by: Jim Langston | last post by:
Someone made the statement in a newsgroup that most C++ programmers use smart pointers. His actual phrase was "most of us" but I really don't think that most C++ programmers use smart pointers, but I just don't know. I don't like them because I don't trust them. I use new and delete on pure pointers instead. Do you use smart pointers?
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7547
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.