Allowing combo box to accept blank entries (1 Viewer)

Mezta1988

Registered User.
Local time
Today, 18:07
Joined
Jan 22, 2019
Messages
41
I think the User-define type not defined error an object library issue. But anyway thank you again for your help...
 

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,261
Ah. I thought we'd discussed references earlier but it seems not.
You should have the following 5 items



The first 4 are standard but you need to add the last one yourself.
The path should be similar to what I've shown
NOTE: If using Access 2016, all the 14.0 values will be 16.0
 

Attachments

  • Refs.PNG
    Refs.PNG
    12.1 KB · Views: 125

Mezta1988

Registered User.
Local time
Today, 18:07
Joined
Jan 22, 2019
Messages
41
Hi,

I solved the error for object library by following the picture you posted earlier, but new error comes up again from the "GetPathWithoutFilename".

Compile Error:

Sub or Function not defined.
 

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,261
Its one of the items in the modFunctions module.
If you are going to use my code, you need to use each part of it!

Suggest you import the entire module to your database
 

Mezta1988

Registered User.
Local time
Today, 18:07
Joined
Jan 22, 2019
Messages
41
I dug every corner of you database but I'm still getting an error, I'm even still working on it right now but those error codes seems to be so keen to show up :D.
 

Attachments

  • ImagePath.jpg
    ImagePath.jpg
    49.1 KB · Views: 46

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,261
IsRelative is a function in the same subform

Code:
Function IsRelative(fname As String) As Boolean
    ' Return false if the file name contains a drive or UNC path
    IsRelative = (InStr(1, fname, ":") = 0) And (InStr(1, fname, "\\") = 0)
End Function

Did you COPY ALL the code from my example app or just bits of it?
Perhaps reimport all the code?
 

Mezta1988

Registered User.
Local time
Today, 18:07
Joined
Jan 22, 2019
Messages
41
I don't think I missed something, All I know is I copied all the necessary codes both from the main form and subform.
 

Attachments

  • Photo to file path with button.zipx
    1.4 MB · Views: 60

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,261
You did miss a couple of important things
Most importantly you changed the autonumber field name from ContactID to ID but didn't update the related code.

Its now working
Changes made to cmdAddPhoto_Click code:
1. Added code to save new record before adding photo (If Me.Dirty Then ....)
2. Changed both SQL statements to use your ID field (my code had ContactID)
3. Removed Me.Requery at end - this isn't needed on your form and it returned code to first record

Also I strongly recommend that you do NOT
1. store Age as a field as it will continually go out of date
If you want you can use a function to calculate age based on DOB
You can find lots of examples online or in this forum
2. use spaces in database names or folders

Also DO
3. compact your database before uploading - note how much smaller it is now!
4. add code to disable the photo button until person details have been entered

Good luck
 

Attachments

  • Mezta1988_v2.zip
    39.1 KB · Views: 53

Mezta1988

Registered User.
Local time
Today, 18:07
Joined
Jan 22, 2019
Messages
41
@isladog Sorry if it's took a while for me respond, I got busy yesterday on one our site and just got home right now. By the way I'm creating a simple query filter using a form and a combo box but the problem is when every time I put a criteria on one of the fields then the records get missed up. I even tried to change the jointype.
 

Attachments

  • RelationalDatabase.zip
    45.4 KB · Views: 49

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,261
That's a separate question. Please start a separate thread
 

Users who are viewing this thread

Top Bottom