Cannot Stop Blank Forms!!
Dec 6, 2006
Hi guys,
I have created a form based on a query that prompts the user to enter a persons name. Once entered, the persons data appears on the form and some other related data appears in a subform. However, I have found a problem that occurs when a name is entered that doesnt exist on the database... the form opens completely blank!! even text and graphics disappear!
Is there a way of stopping this from happening??
Thanks, James
View Replies
ADVERTISEMENT
Nov 29, 2006
Ok - really need some help here. I have searched and searched but i think my problem is slightly different to the ones i am finding.
Basically i have a form and i want to force users to fill in one out of 4 tick boxes. If none of them are ticked when they press the close button i want the form to stay open and a message box come up.
I can get the message box part to work but the form still closes down.
The reason for this is that when the form closes it goes to another form that is linked to it by a unique ID number. This works by the following code.
Private Sub BTN_INVIS_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm closure"
stLinkCriteria = "[issue ID]=" & Me![Issue ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BTN_INVIS_Click:
Exit Sub
Err_BTN_INVIS_Click:
MsgBox Err.Description
Resume Exit_BTN_INVIS_Click
End Sub
What i have tried to do is insert a piece of code into the above to generate the message box so it now looks as follows:
Private Sub BTN_INVIS_Click()
If [Transport_Delivery_issue_] = False And [Process_issue_] = False And [Design_issue_] = False And [Supplier_issue_] = False Then
MsgBox "You must complete the liability box before you can close this issue"
Cancel = True
[Design_issue_].SetFocus
End If
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm closure"
stLinkCriteria = "[issue ID]=" & Me![Issue ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BTN_INVIS_Click:
Exit Sub
Err_BTN_INVIS_Click:
MsgBox Err.Description
Resume Exit_BTN_INVIS_Click
End Sub
This code checks the boxes and generates the message box if none are ticked - that works great. However it doesnt stop the second part of the code (the move to the next form) from executing if the boxes arent ticked.
Would really appreciate it if someone could help me - i'm fairly new to coding so the whole database is a bit cobbled together (mostly with help from this forum!).
View 3 Replies
View Related
Dec 16, 2011
I have a button that opens a form based on a query, the query is filtered based on an input field. This works great except when the user typos what they put into the input field. Since the query pulls no records it just opens a blank form. I want it to not open the form and instead open a message box telling the user the data they entered is not valid and to try again.
View 1 Replies
View Related
Mar 25, 2013
When entering information into a blank form, I would like to be able to continue entering information to another additional blank form after my last entry. Is there a way to continue to a blank form after entering information into the previous blank form? I would just like to continue without having to close the entire form and then reopening another form.
View 7 Replies
View Related
Mar 22, 2006
Hi all,
I have a form that i use for data input, I have limited all of the menu's how ever the print option is still available. This leads to muppet users printing out the form and using it.
There is a print button on the form that prints a report out that lays out the form into a useable item.
So the question is... How can I stop people being able to print out the form?
Thanks in advance
Steve
View 14 Replies
View Related
Sep 16, 2014
But I use one for creating new records in a table.
And one to View/Edit exiting records.
When I open an existing records, and tab through the fields. Once I pass the last field it creates a new record.
View 2 Replies
View Related
Dec 17, 2014
Everytime I change the picture of an image, a duplicate is made. I can see this in the "Insert Image" menu. It this moment, I have over 6000 duplicates which slow my form down alot. I know that you can delete these duplicates by accessing the system tables, but is there a way to stop this automatic duplication? An example is a button that makes an arrow change direction. Every time you click the button, a duplicate of the picture gets saved.
View 2 Replies
View Related
Apr 3, 2013
I have a database that lists all the books I have read. The Table "Books" holds "AuthorId' "Title" etc. I have another table that is called "Whats Next To Read" which I store the next book that I will read from that author. It also uses "AuthorId" and "Title" etc. In the form, how can I look to see if the title put in for that author in "Whats Next" does not have the same title already in "Books" table. I can use Dcount to find the title but it could be same title different author. I need same title with same author.
This is what I have so far.
If DCount("Title", "Books", "Title = '" & forms!Whatsnexttoread!Title & "' > 0 Then
Msgbox "Title is already in books.", vbInformation
End If
I need it to only look at the same author.
View 3 Replies
View Related
Nov 13, 2013
I have created some control buttons using the built in functions of Access2007 and then using the script supplied here modified the control.
So far the controls can add new record, save record, exit form, open next form and close existing form, open previous form and close existing form.
My next question is when the user reaches the end of the form fields how do I stop the form from automatically starting a new record?
For example, I use the TAB key to move from field to field and when I tab out of the last field the form goes straight to the next empty record.
I want this to be a deliberate action performed by clicking the Add New Record button and not an accident of a key press.
The other thing is, how do I get the form to open with blank/empty fields and not at the first populated record?
Some of the data is updated frequently so the records need to be able to be edited but I need to prevent accidental editing of the existing records.
View 14 Replies
View Related
Jun 18, 2015
NO matter what I do I can't get the InputBox to work
Code:
NewEmailAddress = InputBox("There is no Client Email Address on file would you like to enter one?", "Information Required")
It just won't display or stop at the above command.
View 11 Replies
View Related
Nov 15, 2013
I am using Access 2013. I have a form with 2 subforms, each time the form is opened, the first record on both subforms are selected. Is there a way to turn off the record selector so no records are selected when the form opens?
View 3 Replies
View Related
Sep 9, 2014
I created a command button from using the wizard so when I click to delete the record the button is for, a window pops up asking if I am sure I want to delete the record. Is there a way to not have the button pop up?
Here is the code:
Private Sub cmdCompleted_Click()
On Error GoTo Err_cmdCompleted_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
Exit_cmdCompleted_Click:
Exit Sub
Err_cmdCompleted_Click:
MsgBox Err.Description
Resume Exit_cmdCompleted_Click
End Sub
View 3 Replies
View Related
Sep 4, 2013
I have an order form that auto-populates details from the customer table into adderss and contact controls. But I don't want it to auto-populate when the underlying order table already has data in the related fields. Here is the code I use on Load form event...
======
Private Sub Form_Load()
'Use this version if the ID is a number
Dim x As Variant
Dim strControl As String
Dim lngID As Long
'If parameters exist, use them
If Len(Me.OpenArgs) > 0 Then
[Code] ....
View 2 Replies
View Related
Mar 6, 2013
I have some code (see below) that checks if the start date text box is blank or greater than the end date, and if so, generates a message box and sets the focus back to the start date textbox. There are command buttons on the form that open queries based on the date fields. This all works fine.
However, if the user changes his mind and closes the form without filling in the date field, the message box "Please enter a start date" pops up repeatedly. How do I specify that a text box is required UNLESS the user is closing the form?
Code:
Private Sub txt_startdate_LostFocus()
If ((IsNull(txt_startdate) Or (txt_startdate) = " ")) Then
MsgBox "Please enter a start date.", vbOKOnly
[Code].....
View 3 Replies
View Related
Apr 26, 2013
I am building a student register for a school for disabled children. There is a screen listing all students, one showing detailed student data chosen by #=IIf(IsNull([ID]),"(New)","Open")# clicking on "Open", one listing all the guardians, choosing a guardian by #=IIf(IsNull([ID]),"(New)","Open")# clicking on "Open", to diaplay Guardian details.
From the student list, I select and view student details, including a pointer to their guardian details. After selecting the first student details, and then viewing their guardian data, any subsequent student details and guardian details updates the prior guardian data with the next guardian's data.
How can I prevent the successive guardian details from updating the prior guardian table when it is exited? I view the guardian details using ADO recordsets populating a form. When I exit, it updates the previous record.
View 1 Replies
View Related
Jun 20, 2014
I have a form in which user will enter few values but I need users to enter the comment in relevant text box too only if they have any non zero value.
I have attached an example for reference....where red encircled portion is for values and blue is for relevant comments. If value is non zero then user should be enforced to enter the comment too......system should not allow user to move forward or backward until there is some comment.
View 1 Replies
View Related
Dec 17, 2013
How do you prevent access from adding a new record when u input data in the current record or tab to the next field? My database is set up to open with a form where the user picks his name and then a week ending date once that is complete u open a new form where the name and date auto populate along with other fields to fill out such as job charge, charge type , times charged for each day of the week. But I don't want access to create a new record everytime the person inputs or tabs..... .
I have attached my database for better clarity!
View 9 Replies
View Related
Aug 29, 2013
how to stop user from leaving field without selecting item or entering data
View 2 Replies
View Related
Jul 18, 2013
I have a couple different reference files that get updated each week. Sometimes there are missing data elements, so I'd like to structure a select query to show me those records that have blank elements but I'd like the similar records to be pulled in as well, so I can make a determination as to how to populate the blank records..
See attached example: I have a client ID reference table that gets populated with forecast owner names (individuals responsible for the customer) from a couple of different sources. Sometimes there are names attached and sometimes the field is blank.
How can I structure a query to show me just those Client ID's that have multiple entries with blank AND non-blank forecast owners? I'd also like to exclude single/multiple records where there are only blank records...
View 3 Replies
View Related
Jul 6, 2007
Good morning,
How do I print blank forms in Acccess?
tia Terry
View 1 Replies
View Related
Mar 13, 2007
OK, I have been searching around on the fourm for over an hour now...I give up. If this is some where else, I am sorry.
I have a database of maintenance data. There are several columns that are usually filled in, some records have some columns blank. They are formated text because they hold letters and numbers (see pic).
I am using a form to query the table...no problem. The form has text boxes the user filter down the data
The problem comes are with the results of the query. Any record that has a blank column is not retuned. I am using "Like" so that the user can enter in partial codes. I know "like" won't return "null" records.... Help!
Things I have tried:
1)IIF(form field is blank, return table field, else use like command to filter) - returns nothing!
2)Like "*" & [Forms]![Fleetwide_data_Request]![MAL_CD] & "*" returns all records without blanks (i.e. missing data)
what else can I do?
Thanks
View 5 Replies
View Related
Oct 26, 2005
I am setting up a form with a few tables in it.
I want each table to relate to the form.
When the Next button at the bottom of the page is clicked I want all the values of each table recorded even if there were no values put in the boxes.
For example if there is no value added to the field boxes in say half the tables I want the default value to be recorded as blank or zero so that each table has the same Autonumber associated with the other tables in the form.
What is the best way to do this?
s
View 5 Replies
View Related
Jun 6, 2005
I'm trying to make a form so that it opens up to a blank/new record. Any tips? Can't seem to figure it out.
Thanks, Jonathan
View 14 Replies
View Related
Mar 10, 2015
I have a listbox in my database to show the items filtered from comboboxes. But, I could see several blank spaces on the right most part whenever I scroll my database on the right side. how to delete those blank spaces? by the way, i have correct/exact column count already.
View 11 Replies
View Related
Jul 1, 2015
I have a form based on a table with just sales quotes and dates. I am using the salesquote as a combo box to select corresponding records in a subform.
Code:
Private Sub cboSalesquote_AfterUpdate()
Me.Filter = "[salesquote]=" & cboSalesquote
Me.FilterOn = True
End Sub
Works fine. But not the mgr says his users get confused when they are making changes in the subform which record they are changing so they want when they select a record from the combo box and the records appear in the subform; they want the combo box to go blank. I am not sure how to do this because if I reset the combo box to go blank; the subform records will go blank as well.
View 5 Replies
View Related
Jun 26, 2013
In Access 2007 I'm trying to print out a blank form so users can fill in rough notes while on the phone with a client, etc. I currently have a print macro button on the form, but the entire page shows up blank (titles, everything) when I try to print a an empty form.
A possible solution I've thought of is to check if the form is blank and then open and print a separate report that's just a copy of the form and printing that, but it doesn't seem like a very elegant solution.
View 7 Replies
View Related