Records sets Ouch !

Records sets Ouch !

Post by Bernar » Fri, 20 Apr 2001 22:01:30



Hi,

I need help !!!!

I'm Writing a databasein  access using VBA. I' ve created a form and in the
form i've written a check againts selling quantity. Where the selling of
goods cannot be more than the balance.  What I've done is that once the
Stock Id is entered the focus goes to Selling Quantity.  The problem here is
if the selling quantity is more than the balance on stock it give a message
box that the the selling quantity is higher, This uses a custom  message
box.  What i want to do is make the user correct the figure there.  it
doesnt seem to be working.  The message appears , OK is click it,  goes to
the next focus, the retailers ID to be entered.  I want the cursor/Focus  to
remain on the Selling Quantity until the user enteres the correct figure.
thried on the coding for hours nothing seem to be working. Please Help

Bernard

 
 
 

Records sets Ouch !

Post by Hank Hennige » Sat, 21 Apr 2001 05:35:43


I'm not sure about VBA but in VB you can just have it set focus:

if txtOrderCount . stockBalance then
  msgbox "You're maximum order can be " & stockBalance, vbOkOnly
  txtOrderCount.setFocus
end if

This will force the focus back into the order text box when the user hits
the OK key and do so until it meets criteria.

 
 
 

Records sets Ouch !

Post by Kim McKenzi » Sun, 22 Apr 2001 03:32:52


You can set the focus back but you need to leave the user some way out of
the application in case they don't get the number correct.  Say that there
is a qty in stock of 3 and the person is trying to sell 100 and no matter
they want to sell as many as possible.  Will they have to keep backing up 1
until the get to an acceptable number (3 or less)?  So my suggestion is to
either display the amount on hand or to put it in your error message or
allow them to cancel out from the error message.

Does that make sense?


Quote:> Hi,

> I need help !!!!

> I'm Writing a databasein  access using VBA. I' ve created a form and in
the
> form i've written a check againts selling quantity. Where the selling of
> goods cannot be more than the balance.  What I've done is that once the
> Stock Id is entered the focus goes to Selling Quantity.  The problem here
is
> if the selling quantity is more than the balance on stock it give a
message
> box that the the selling quantity is higher, This uses a custom  message
> box.  What i want to do is make the user correct the figure there.  it
> doesnt seem to be working.  The message appears , OK is click it,  goes to
> the next focus, the retailers ID to be entered.  I want the cursor/Focus
to
> remain on the Selling Quantity until the user enteres the correct figure.
> thried on the coding for hours nothing seem to be working. Please Help

> Bernard

 
 
 

1. Record Set Guru's - Can't Create Record Set error 429

Hi All,

(Excuse me if this is a repost because I had trouble with my news reader.)

I have tried and tried to figure this one out and I am stuck.  I have an
COMponent created with VB5 that runs under MTS and is accessed via VBScript
ASP pages.  For some strange reason when my VB5 object tries to set a
property of the record set it created I get:
"Error  429 , ActiveX component can't create object"  This same method
worked previously.  I have tried everything, even reinstalled OLEDB SDK.
Code snippets follow:
On Error GoTo ErrorHandler
Dim oConnection     As New ADODB.Connection
Dim oCommand        As New ADODB.Command
Dim oRecordSet      As New ADODB.Recordset

'Open the connection to the data source
oConnection.Open sDSN, sUID, sPSW
Set oCommand.ActiveConnection = oConnection
'Set up parameters
oCommand.CommandText = "sp_SomeSP"
oCommand.CommandType = adCmdStoredProc
oCommand.CommandTimeout = 20
oCommand.Parameters(1) = "some parameter value"
'Here is where I get the error!
oRecordSet.CursorLocation = adUseClientBatch
oRecordSet.Open oCommand, , adOpenUnspecified, adLockBatchOptimistic

'Clean up
Set oConnection = Nothing
Set oCommand = Nothing
Any Help would be greatly appreciated!!!!!
Mike Alvarez
POV Partners

To reply via email remove the anit-spam part address

remove the anit-spam part address

2. DAO 2.5 Problems: Application written under 95 does not run under Windows for Workgroups

3. Converting from ADO Record Sets to a ADO.NET record set object

4. Subselect views 5.01 ==> 7.10 return 0 rows

5. Set a record set in access

6. SQL 2000 stalls backing up DB via maint plan

7. Setting Record Set connectivity involving joins.

8. CREATE DATABASE creates "memory leak"

9. Setting Repeating Fields from found record set in another database

10. Randomly selecting records from a record set

11. Select multiple top 5 record from single record set

12. randomly select records from a record set

13. HELP: Selecting a Specific number of Records from Record Set