How Do I Code A Message If Two Records Have A Replicated Field?
Jun 12, 2007
How do I code the following?
I have a field in a table called surname. This is not the primary key and I don't want to set it as a unique field however I want there to be a message box that comes up saying "There is already another person of this surname (or something like that" if the surname entered already exists in the database.
I have a file that I need to import on a regular basis. There are two different issues with the import:
1. the first digit in the file indicates if it is a record I want to keep. In this case a 1 indicates a repair record and an 8 indicates it is just information such as email, contact info etc.
2. I have a field in the file that may change the import specifications
For example:
If the record is a Non wheel repair then column 167 is a 50 character description If the record is Wheel repair then column 167 is a 28 character description and the remaining 22 characters are broken down into 10 different fields
So I need to do the following
1. Read the first character in the line and determine if it is a number 1 and if not discard it 2. Read a field in column 109 that is two characters long and if it says it is a wheel repair the import will break column 167 -216 down to the appropriate 11 fields and if it is a non wheel repair it will import columns 167 - 216 as one big description field.
I have used the import specifications with Access but it seems this will have to be done in code in a module or something and I am not very good with VB. (only know the basics)
One other issue is I have dates in the file that are 130225 and 1302 (so full date and then Year/Month) if i take out the / date separator in the import spec the full date works but the Year/Month doesn't.
I am trying to write the code which will show a Message Box if another field in a table is "Not Null" . Here is what I am attempting:
Upon exit of [JobFieldname] Look at record in [Table].[Jobinfo]. where [JobFieldname] match If [Yes/Nofieldname] = "Yes" then Open Message Box "My message Here"
Can someone help me? I havn't found the answer looking through the threads.
Hi All, Is it possible to have just one instance of this message box fire when one or all or any number of the flags are triggered. At the moment if 2 flags are set then 2 messgage boxes appear,if 3 then 3 messages etc. My code at the moment is below to trigger the message box, hope I make my self clear;can it be tidied up?
private Sub Form_Current() If Me.Flag1 = "Patient Alert. HIGH RISK. Med Hist" Then MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment" End If If Me.Flag2 = "Patient Alert. ALLERGY. Med Cond" Then MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment" End If If Me.Flag3 = "Patient Alert. Cat Score. LOW. Caution See Notes" Then MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment" End If If Me.Flag4 = "Patient Alert. PATHOLOGY. Int/Ext Exam" Then MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment" End If End Sub
Hi All,:confused: need some code help again, I dont seem to be able to get the hang of message boxes!! The code below takes the path to a mdb file which is stored in a text box on my form, it then deletes an existing table -Expire-and replaces it with a new table also called Expire from the database located at the file path in the text box.
Private Sub Command6_Click() Dim tmpFilePath As String tmpFilePath = Me!Text1
I have a replicated database with open access, permissions granted at the folder level. Database users have requested that a form be created where data can only be entered but not modified - for data entry clerks.
I want to create a separate replica for data entry users clerks with only the data entry form available which means that they cannot see other replicated items in the main database. However, if I unreplicate some of my items then my fully functional replicated databases would not synchronize properly.
I have created command buttons to enter event registration information after biographical information has been completed. When I click on the button I get the following error message:
"Microsoft Office Access cannot find the field '|' referred to in your expression."
This is the On Click code that I have in there. Can anyone spot the error of my ways?
Private Sub RegisterButton_Click() On Error GoTo Err_RegisterButton_Click If IsNull(Me![AttendeeID]) Then MsgBox "Enter attendee information before registering for an event." Else DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenForm "Registration", , , "[Registration]![RegistrationID]=Forms![Attendees]![Attendees Subform].form![RegistrationID]" End If
Exit_RegisterButton_Click: Exit Sub
Err_RegisterButton_Click: MsgBox Err.Description Resume Exit_RegisterButton_Click End Sub
I would like to put a message on the screen for informing the user - mostly during some procedures that might take time or when, after a warning, I want to go on with the program but without action from the user.
Msgbox is obviously not the one I'm looking for as it needs customer acknowledge. Is there a solution for this task?
First some background. A few months ago I replicated an Access 2003 database so that folks in various locations could all enter data. There is one master and 3 copies. One of these copies was operating on a computer with Access 2000 and it also happened to be the copy of the database that gave me some headaches (never with the synching) which I am almost positive were related to the version difference.
So, despite those other problems this copy of the database synched up fine throughout the summer. Now all the sudden I have found a few recently entered records in the copy which are not being transferred during synchronization. And from what I have been able to tell so far they seem to be from a particular data entry session on a particular date. I have already looked through the records in question to see if they are missing an important field of data or something and they seem to be complete and legitimate records.
I have tried a number of things and at this point am at a loss as to where to go next. Does anybody have experience with replicated databases and potentially run into this problem before? Any advice on what to look at next to figure out the casue and the fix?
I have a replicated databse that is used in both 2003 and 2007. Most development is done in 2003. I have stability problems with replicated/synchronised databases when running in 2007. The database normally opens with a switchboard menu, but on occassions the following error occurs:- "THE EXPRESSION ON OPEN YOU ENTERED AS THE EVENT PROPERTY SETTING PRODUCED THE FOLLOWING ERROR: OBJECT OR CLASS DOES NOT SUPPORT SET OF EVENTS". Once this happens the databse will not open. I have to create a new replica which may or may not work. The strange thing is that I can run the database failing in 2007 from another rmachine that is running 2003, so it seems that the problem is specfic running 2007. Any suggestions or help would be appreciated.
I have created a design master of my database, i want to share it on more than one PC but add data from both whilst keep developing it.
I have noticed that after replication that the ID fields now use really long random numbers and am wondering whether anyone has been able to control the 'randomness' of the autonumber?
I have created a custom message box form that suits my needs for this particular situation. It is called (opened) in the middle of a bunch of other VBA procedures. What I am having a problem with is how do I "pause" the rest of the code from running after the message box call?
For example, with a regular msgbox() function, once called, the code will wait for the user input or click of a button, then continue. My problem is that I am using the basic docmd.openform procedure, and it opens the message box form just fine, but then continues on with the rest of the code after the form is opened.
How would I "pause" the code after the call of opening my custom message box form, then continue it after the user clicks one of my closing buttons from that form?
Furthermore, although its not entirely needed in this situation, for future reference, how would I have that message box form return a value to the calling procedure?
I need to create a message box or a form or something to flash on the screen to tell the user that a piece of "Update" code is running. the update code will be updated reports from marketing returns, but the 3 branches who use the information are separate so I am creating an update form to download and update the table.
The code for the update is already working, but can take a while, so I thought a message or splash screen would be useful as the update runs on start up.
It would have another use, I have a report which is made mainly of calculated fields on an onPrint event and also takes a while to work it out, so a similar screen would be more useful than my current spinning circle and blank screen.
Not being a code person. This code worked great for 2003, but we just installed 2007. I get an error message when the this code runs:
Its a complie error User-defined type not found
Sub ShowUserRosterMultipleUsers() Dim cn As New ADODB.Connection.....red shows where I get the error message Dim rs As New ADODB.Recordset Dim i, j As Long
Set cn = CurrentProject.Connection
' The user roster is exposed as a provider-specific schema rowset ' in the Jet 4.0 OLE DB provider. You have to use a GUID to ' reference the schema, as provider-specific schemas are not ' listed in ADO's type library for schema rowsets
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _ , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
'Output the list of all users in the current database.
i have a form which contains three subforms. the subforms are based on queries which get their parameter value from an option group. all this was working fine until i had the bright idea of displaying a msgbox when no records are found in the subforms.
i had entered the following code that i had found on one of the posts in this forum:
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then MsgBox "There are zero records in the data source!", vbInformation, "No Records Found" DoCmd.Close acForm, Me.name End If
End Sub
the trouble is that if the user makes a selection in the option group whereby there are no records in two or more subforms, it throws up two different msgboxes stating the same.
I want the form to be such that everytime the subforms are requeried, there shud be only one msgbox stating tht no records were found for the relevant subforms. (this msgbox doesnt appear when there are records). for eg the msgbox shud say that "no records found for subfrm1 and sbfrm2 etc". if subfrm 1 and two don't have records but subfrm3 does.
I am using a query to search for records and I'd like there to be a message box that pops up on the search page if there are no records found (so the query is empty). I'm guessing there is a simple solution since I think I just need an "If" statement checking to see if a field in the query is null or not. However, I'm not familiar with Access code and what I've tried so far does not work. Any help is greatly appreciated! p.s. I am using Microsoft Access 1997...old school...
I have a table that is a list of available UPC codes that through forms are being assigned to several different tables (types of items). When the UPC code is assigned, there is a yes/no box which is checked. I need to have a message box appear when the last of these UPC codes has been used (or better yet perhaps when there are a specific number left - such as 10 - so the user isn't all of a sudden locked out of any more work).
It could even be triggered when a specific UPC code is reached - they will be in numerical order (ignoring the check digit). Is there anyway to do this globally or would the check need to be on each form as the UPC is assigned?
Hey. Basically I have several tables. One table (vistiors) has a combo box in one field called Hostee. Each hostee is listed in another table with all their information. When a hostee is selected in the hostee field of the visitors table I simply need it to count how many people including the currently selected person are being hosted by the person and check if it is greater or less than the amount of people set in the host table which has a field called Limit that has a number which is the maximum amount of people one person is willing to host.
If its greater than the amount in the host table a warning message should come up informing the person (but still allow the assignment to occur.)
As a note I have the combo box set to show the first name of the individual but select both the first name and ID
the code is below for the row source:
SELECT [Hosts].[First Name], [Hosts].[id] FROM Hosts;
If someone could tell me how I could get it to show multiple things within the combo box that'd be great.
IE Right now it shows just a first name liek Alex, Rachel, Bill. I'd like it to show the first name as well as the last name and a third additional field. IE Alex Lastname T1 or Rachel Lastname F4 etc.
Can anyone show me the general code to do this? I do know some VB but I'm used to using SQL with PHP primarily. I am new to access and only know it vaguely. Thanks in advance!
I have two tables, categories and items. I have a form that is linked to the categories table and a subform that is linked to the items table. The user selects a category on the main form then an item to add to the category on the subform. (all of this is functioning correctly - but you need to understand for my question.)
Both the form and the subform have a text box that displays a record from their respective table, for the example we will call this color.
What I need to do is create code that checks the color text box from the category (main form) against the text box for the item (subform) and if they are not a match I need to display a message box - from where I can then add the necessary actions.
EDIT: note this is not a query on an entire table or 2 it is just comparing the two text boxes on the form and subform
I have a button that duplicates records 'X' amount of times based on a value in a text box.
I need a message box to advise the user that they have created record number from - to
Eg
User creates 5 records - first record created has a auto number of 3200
I need the message box to say 'you have just created records 3200 - 3204
Is this possible?
Here is the current code on the duplicate button courtesy of Uncle Gizmo
Private Sub AddRecord_Click() On Error GoTo AddRecord_Click_Err Dim x As Integer For x = 1 To (Me.txtAmount.Value - 1) DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdCopy
The record source of a form that I have is based on a user selection in a combo box in the header of the form. When the form opens there may or may not be any records to display. Currently I put up a message box when there are no records displayed but this only happens when the form is newly opened.
I was wondering if it is possible to have a label displayed in the detail section instead whenever there are no records to display, such as something along the lines of "There are no records to display with the selected option, please choose an alternative.".
I realise that I may be asking the impossible but I'm a member of the "If you don't ask you'll never know" club.
I have a form designed to execute a query with a prompt for a particular record. When the record being searched for is not there the form become blank with nothing on it. I would like to return a message that indicates that the record was not found and give he user an option of reexecuting the query of exiting the form.
I am trying create some code that checks if the contents of the status field in a table is "Authorised" where the ID = something specific for multiple records. If all records witht the specific ID are "Authorised" Then generate a new record in another table. Where to start, perhaps a Dlookup?