Thanks to both of you for your replies. The InputBox VBA function looks to be just what I need, so thanks for that PHV. Aceman - nice idea but I'll go with the inputbox.
Simple problem except I can't work out how to do it.
I've a date field on a form. The subform data is linked to that date. I want the user to be able to change the date but only explicitly by clicking a button, being prompted to enter a date, then entering that date. The button should then...
Thanks for all the replies - it was the last line of that of RoyVidar that helped me see the light. The Current event of the form was calling various display functions however some of them were assigning values to bound as well as unbound fields. Hence a new record was being created each and...
Yes, but the problem is that the record has already been created therefore no matter if the user chooses yes or no the record will still remain. Ultimately the end user should not have to be concerned with these "ghost" records at all.
The same form is used for entering records, viewing records, editing records and deleting records. The user is also able to select various subsets of records by double-clicking on query names in a listbox.
I want to stop "ghost" records being created. At the moment if there is an empty...
The dCount function isn't able to enter in such a parameter therefore it returns "The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object 'Enter Staff ID.''"
To give this some context: the query names are all in a listbox on a form...
Here's the SQL from the query...
SELECT Notes.Logged_By AS N_LoggedBy, Notes.*
FROM Notes
WHERE (((Notes.Logged_By)=[Enter Staff ID]) AND ((DatePart("yyyy",[Date_Received]))=DatePart("yyyy",Now())) AND ((DatePart("y",[Date_Received]))=DatePart("y",Now())));
Ah - I like that solution.
I've copped on as to why the parameter error was coming up - the two queries in question both request a Staff ID to be entered (it's a 5 digit number). Any ideas on how I can deal with that problem?
I've done a search for this in the forum but can't find the exact answer. All I want the piece of code to do is to tell me if the query returned records. I've included my code below. At the moment it runs fine if there are records to return however it produces the following error if there are no...
I've got a query that is used as the data source for a form. However if the query returns nothing the form is completely blank - i.e. no controls appear at all.
How do I ensure that the query returns at least one record, even if that record just has something in a calculated field (e.g. the...
Jebry,
I tried your code as is - pasted it straight in. Same result as with mine.
What I've decided to do as an interim solution is to use the close button in the corner (i.e. solution #1) but to trap the error message and supress it. It's error 2169 - as far as I know it's a known bug in...
I already tried a variation of that (it was identical except it said "logging this record" instead of "closing").
It seemed like the obvious solution however the form's BeforeUpdate() kicks in after you say no.
Here's the sequence of events...
DoCmd.Close
BeforeUpdate then kicks in and...
Just the standard exit code:
Private Sub Button_Exit_Click()
On Error GoTo Err_Button_Exit_Click
DoCmd.Close
Exit_Button_Exit_Click:
Exit Sub
Err_Button_Exit_Click:
MsgBox Err.Description
Resume Exit_Button_Exit_Click
End Sub
I've been going to hell and back with this one.
I've got a form that I'm using for data entry. Users enter data and then press a "Log Case" button to enter their userID and a timestamp. It is not essential that all cases be logged straight away but it is essential that a user be prompted to log...
Good point.
UserID was a bad example - the fields that need to be queried are all 1 character fields, e.g. 'R' or 'P', except the date field. So, it's fine for all of them. This method works for the date field when you either enter a specific date or no date at all (which is still fine)...
I've got a table that I want to get information from. Within the table there are five fields that need to be queried. However, the user should be able to disregard a parameter if they don't care about that field. It is a simple database that I'm setting up for someone to hold some very basic...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.