Question Help with converting database from 2003 to 2010 (1 Viewer)

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
Hi All,

I am trying to bring my work database slightly more up to date and convert it from access 2000 format to the 2007 format.

I have managed to get everything working apart from one part where i am getting the following error as pic attached.

This error is happening when i try and select a name in the top left box.

I am a complete noob with this so need help in layman terms please as i did not write the database.

Thanks very much
 

Attachments

  • Untitled.png
    Untitled.png
    45.2 KB · Views: 115

theDBguy

I’m here to help
Staff member
Local time
Today, 12:40
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF! This error must be coming from a piece of code, correct? If so, examine the code and make sure it's not trying to send the focus to a control that can't accept the focus.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:40
Joined
May 7, 2009
Messages
19,169
bring your form in design view and check if indeed you have "companyName" textbox there.
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
Thanks for replying so quickly :)

The box in design view just says Unbound....
 

Attachments

  • Untitled2.jpg
    Untitled2.jpg
    104.3 KB · Views: 99

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
i have no idea how to do that...

Please can you tell me how?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:40
Joined
Oct 29, 2018
Messages
21,358
i have no idea how to do that...

Please can you tell me how?
Okay, assuming the error message is coming up after you select an item from a dropdown, then go to the design view of that dropdown and look for the AfterUpdate event property. Once you find it, click on the three dots (...) to the right of it and then copy and paste the code that shows up into your reply.
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
Option Compare Database 'Use database order for string comparisons

Private Sub Button57_Click()
On Error GoTo Err_Button57_Click


DoCmd.Close

Exit_Button57_Click:
Exit Sub

Err_Button57_Click:
MsgBox Error$
Resume Exit_Button57_Click

End Sub

Private Sub Form_AfterUpdate()

End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:40
Joined
Oct 29, 2018
Messages
21,358
Option Compare Database 'Use database order for string comparisons

Private Sub Button57_Click()
On Error GoTo Err_Button57_Click


DoCmd.Close

Exit_Button57_Click:
Exit Sub

Err_Button57_Click:
MsgBox Error$
Resume Exit_Button57_Click

End Sub

Private Sub Form_AfterUpdate()

End Sub
That looks like a code for a button you click. I thought we're getting the error when you select from a dropdown?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:40
Joined
Oct 29, 2018
Messages
21,358
That looks like a code for a button you click. I thought we're getting the error when you select from a dropdown?
Hi Mike. I'm about to step out for a lunch break, so it might take some time for me to respond if you post something back after my last post.
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
Hi its when i try and select one of my suppliers in the drop down list.

When the error comes up i have to exit it to be able to select design view and close the error box as below.

Or did you mean as the second pic attached?
 

Attachments

  • Untitled2.png
    Untitled2.png
    67.5 KB · Views: 96

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
2nd Pic.......
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    89.9 KB · Views: 91

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:40
Joined
May 7, 2009
Messages
19,169
did you bring your form in design view?
if not do it now.
click on each textbox/combobox.
on Property Sheet->Other->Name, you will see the name of the control.
click each control until you found/ or not found CompanyName.
if not found, click on the Ribbon, Add Existing field.
find the CompanyName there and drag to your form.
go again to Property Sheet->Format->Visible No.

if you don't have companyname in your field, bad luck.
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
did you bring your form in design view?
if not do it now.
click on each textbox/combobox.
on Property Sheet->Other->Name, you will see the name of the control.
click each control until you found/ or not found CompanyName.
if not found, click on the Ribbon, Add Existing field.
find the CompanyName there and drag to your form.
go again to Property Sheet->Format->Visible No.

if you don't have companyname in your field, bad luck.

Company name appears 4 times on the sheet see pic.

I have changed all 4 to no but the error still exists
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:40
Joined
May 7, 2009
Messages
19,169
then, set its Visible property to Yes.
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
They were all set to yes when i checked and i changed them to no as you said?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:40
Joined
May 7, 2009
Messages
19,169
instead of Macro, use Code Builder.
add code to FindSupplier combobox's AfterUpdate:
Code:
private sub FindSupplier_AfterUpdate()
    With Me.Recordsetclone
        .FindFirst "[CompanyName] = " & Chr(34) Me![FindSupplier] & Chr(34)
        If Not .NoMatch Then
            Me.Bookmark = .Bookmark
        End If
    End With
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:40
Joined
Oct 29, 2018
Messages
21,358
Company name appears 4 times on the sheet see pic.

I have changed all 4 to no but the error still exists
Hi. For a control to receive the focus, it needs to be a Textbox or Combobox, or Listbox or subform, etc. It can't be a Label, or other controls that can't receive the focus. In addition, the control to receive the focus must also be Visible and Enabled. So, if you set Visible=Yes, also make sure Enabled=Yes. Hope it helps...
 

Mikeb185

Registered User.
Local time
Today, 19:40
Joined
Sep 18, 2019
Messages
55
instead of Macro, use Code Builder.
add code to FindSupplier combobox's AfterUpdate:
Code:
private sub FindSupplier_AfterUpdate()
    With Me.Recordsetclone
        .FindFirst "[CompanyName] = " & Chr(34) Me![FindSupplier] & Chr(34)
        If Not .NoMatch Then
            Me.Bookmark = .Bookmark
        End If
    End With
End Sub

Thanks, could you explain the steps to do this?
 

Users who are viewing this thread

Top Bottom