DD's Stats

Total Members: 157
Latest: irsmalik
New This Month: 7
New This Week: 3
New Today: 0
Total Posts: 876
Total Topics: 444
Most Online Today: 3
Most Online Ever: 52
(May 02, 2020, 05:24:19 pm)
Users Online
Members: 1
Guests: 1
Total: 2

Recommended Posts

DD Approved Members group Added by DD Admin
05-06-2020, 12:48:35

Posting Additions or alterations rules by DD Admin
27-02-2020, 10:33:01

A Trip Down Memory Lane by DD Admin
24-08-2019, 14:17:16

Todays Birthdays

DD's Top Posters

DD Admin
Posts: 910
Posts: 69
Posts: 12
Posts: 8
Posts: 8
Posts: 5
Posts: 5

Author Topic: ZfrmLevels Error When no records  (Read 8 times)

0 Members and 0 Guests are viewing this topic.

Online DD Admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 910
  • Karma: +5/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, UK
  • Referrals: 16
ZfrmLevels Error When no records
« on: May 01, 2020, 06:00:25 pm »
Found this error when adding this object to the Animal Sanctuary, It will only happpen when the db is new without records to correct it past the code blow in the Form_Current Replacing  what was there.

Code: [Select]
Dim R As DAO.Recordset
On Error GoTo HandleErr

Set R = Me.RecordsetClone
If R.RecordCount = 0 Then
    Me![STxt_LevelOrder].DefaultValue = 1
    If Me.NewRecord Then Me![STxt_LevelOrder].DefaultValue = GetNextLevel
End If

Set R = Nothing

    Exit Sub
    Select Case Err.Number
        Case Else
            MsgBox Err.Number & vbCrLf & Err.Description
            Resume HandleExit
    End Select

On LfrmLevelsLookup Replace the code in the txt_Limit_Change Event

Code: [Select]
On Error GoTo HandleErr
    If Not IsNothing(txt_Limit.Text) Then
        Me.Sub_ZfrmLevels.Form.Controls("SpinUp").Enabled = False
        Me.Sub_ZfrmLevels.Form.Controls("SpinDown").Enabled = False
        Me.Sub_ZfrmLevels.Form.AllowAdditions = False
        Me.Sub_ZfrmLevels.Form.Controls("SpinUp").Enabled = True
        Me.Sub_ZfrmLevels.Form.Controls("SpinDown").Enabled = True
        Me.Sub_ZfrmLevels.Form.AllowAdditions = True
    End If
    txtLimitX = txt_Limit.Text

    Exit Sub
    Select Case Err.Number
        Case Else
            MsgBox Err.Number & vbCrLf & Err.Description
            Resume HandleExit
    End Select
« Last Edit: May 01, 2020, 06:07:12 pm by Michael »

Share on Facebook Share on Twitter


Related Topics

  Subject / Started by Replies Last post
0 Replies
Last post November 17, 2019, 10:17:22 am
by DD Admin
0 Replies
Last post July 12, 2020, 11:15:53 am
by DD Admin

DD's Social Media

DD's Programs

Development Schedule

DD's Freeware


DJ 2020

Chart Tracker Elite

Works Manager

Contact Manager

Simple Home Accounts

Book Library

Picture Library

Project Manager (accde)

Developer Tools

Project Manager (accdb)

Style Manager

Code Library

Open Code Templates

Master Template

Task Management

Charitable Contributions

Bug Tracker Template

Time And Billing Template

Real Estate Template

Household Inventory V1

Open Code Examples

DD's Northwind V1

Employee Example V5

Grid Demo Example V1

Employee Example V4

Small Examples

Recent Topics

Apollo Project Status by DD Admin
January 15, 2021, 11:00:15 am

Apollo Manual: Main Music Player by DD Admin
January 13, 2021, 10:21:36 am

UK Singles/Albums Charts 01 Jan 2021 to 07 Jan 2021 Analysis by borobutch
January 11, 2021, 09:27:29 pm

Please welcome irsmalik to DD by DD Admin
January 11, 2021, 09:34:58 am

Please welcome FamiliaRoca to DD by DD Admin
January 11, 2021, 07:49:40 am

Please welcome Gasman to DD by DD Admin
January 10, 2021, 02:01:23 pm

Please welcome ferrancc to DD by DD Admin
January 09, 2021, 06:21:49 pm

Database Dreams is not affiliated with Microsoft