I have a textbox (Odour), that contains one of four words (Cadaver ( ), Drugs ( ), Explosives ( ) or Money ( ) ), the word is written in by pressing one of four buttons, this works fine.
I now want the user to write in between the the brackets and only the brackets. For example:
The textbox...
On the form I have a tab control one tab is called "GP" the other is called "Detection", once I have chosen either GP or Detection from the combobox, the relevent tab appears.
as you suggested, Refresh on lost focus did it, many thanks.
Ive had search around the forum and have found a few threads about this but cant pin it to anything that Im doing.
The error occurs when I choose from a combobox after having chosen a record from a listbox and then choose the same record again from the listbox and then choose from the combobox...
Thanks for yoru help, well Im nearly there. I just need to check that the file exists. I searched and foun this code but its not working, it always says the the file dosent exist even when I know it does
Dim strhelp As String 'The help folder
Dim strHelpDoc As String 'The...
I need to open a PDF file from a button, now I know th easy way to do this is via the hyperlink in proporties. The problem is the file may or may not be present. It will always be named exactly the same.
I'm assuming that I need to do this in VBA. I have done the code to check if the folder...
Right so I have this in the BeforeUpdate:
Private Sub DogID_BeforeUpdate(Cancel As Integer)
If IsNull(DLookup("[DogID]", "tbl_Profile", "[DogID] = """ & Form![DogID] & """")) Then
' Add ID
MsgBox "New"
Else
' ID already exists
MsgBox "Exists"
End If
End...
Thanks for your help. Your right, the ID can be whatever the user chooses, I would have said but I didn't realise that it made a difference.
Im not sure what you eant by:
"And yes, I did mean to put that may " there."
Got to be honest tIm a bit lost with this right now! I know what I want...
Thanks namliam, unfortunatly that produced a 2471 runtime error (I think it has something to do with some "", but I dont have any idea where the problem is!
Thanks for your help. This where I am now:
Private Sub DogID_BeforeUpdate(Cancel As Integer)
DLookup "[DogID]", "tbl_Profile", "[DogID] = Form![DogID]"
If Me.DogID = DogID Then
MsgBox "This Dog ID is already in use"
Me.DogID = Null
Me.DogID.SetFocus
End If...
Hi cant seem to find what Im trying to do, which I think is quite simple
I have a unique identifier (DogID), its the users reqposibility to put that number in, but I need the code to check the table to see if the number is already in use. I suspect I should be using the DLookUp function. But...
I'm getting a runtime error 13 on this line of code. Its a piece of code to make a directory, but I cant see anything wrong!
strBackUpDogNameFolder = "c:\GPandDetectionDogTrainingLogBackUpsandReports\" & Forms![frm_Profile]![Discipline] \ " & Forms![frm_Profile]![DogName]"
Thanks for your reply and sorry for getting back to you so late.
The problem is that the dog may already be in the clients DB with his unique Identifier, but not in the trainers. The trainer then may crate the dog in his DB and put a different uniique identifier with it. I think this is...
o ou mean each dogs name should be unique as thats not always going to be possible. The person is a trainer and he has dogs come to him for training from different people, so people could call there dogs the same name.
Im having a bit of trouble with the design of my DB.
The DB is a dog training DB. Each dog has a profile with its breed, Name etc and a DogID (this is an autonumber and is the Primary key)
Each dog undergoes training each day and that is recorded on a subform. The subform holds a TrainingID...
Well I've fixed part of the problem.
It was the string, I was only looking for the folder and not the file
sSource = "c:\GPandDetectionDogTrainingLogBackUpsandReports\"
I created an unbound txtbox to hold the name of the file from the cbobox (txt_ImportName). So the code now reads...