SELECT [TERMINATION].*, PAITIENT.NAME, PAITIENT.DOB
FROM PAITIENT INNER JOIN [TERMINATION] ON PAITIENT.ID = [TERMINATION].ID;
ID (tblB)
=> If the ID is from tblA, it says that I am creating a duplicate value in the primary key.
Name (tblA)
DOB (tblA)...
Actually, I have many tables. All other table have one-to-many relationships to Table A. Only Table B does have a one-to-one relationship to Table A. Each table stores a type of medical information with a composite key ID+VISIT while Table A stores the patient's personal info with the primary...
I have 2 tables: Table A is personal info, Table B is termination info. Two tables have an one-to-one relationship by ID. I've created a form to show all fields from Table B and 2 fileds from Table A. I want to enter ID in the form, after clicking Tab, automatically the data of those 2 fields...
Rick,
Thank you very much for your patience and willingness to answer my question.
I got this function work by setting focus to another field and then setfocus back to the field I want. I am new in VB and have read other threads about this issue. I just couldn't believe that this sefocus...
Rick,
Public Function Compare(VarDouble As String, FieldOrig As TextBox, FieldDouble As TextBox)
Dim Result As Integer
Dim Result2 As Integer
Dim Cancel As String
If FieldOrig = FieldDouble Or (IsNull(FieldOrig) And IsNull(FieldDouble)) Then
Else
Result = MsgBox("DATA ENTRY...
Hey, Rick!
Thank you for your reply.
I tried to use the same code on the BeforeUpdate event, but I got Run-time error 2108 and the "FieldDouble.SetFocus" statement was highlighted. "DoCmd.GoToControl VarDouble" had the same message. Do I need to change anythig in these...
Hello,
I use the following function to compare a value(FieldDouble) in B Database to aother value(FieldOrig) in a linked table from A Database. If the FieldDouble is entered differently from FieldOrig, I want the focus stays in FieldDouble.
Neither FieldDouble.SetFocus nor DoCmd.GoToControl...
I created several databases before. They are stored in the hard drive. Then I installed IME for Chinese characters. After installing IME, I went bask to try my database, all the Date/Time variabels don't take the value I enter. I have the input mask "0000/99/99;;_" It really...
I tried "VarB.SetFocus" instead of "DoCmd.GoToControl VarB". It works in the database where I took the code from, but it still doesn't work in my database. Is there any difference between Access97 and 2002 at this point? Any restriction? This field is visible and enabled.
Hello,
I am new in VBA. I took some codes from one database, but something doesn't work.
In a Form view, on VarB field, on Exit, a function will check a condition. After entering the value of VarB and clicking Enter key, if the condition is false, I want the cursor stays in VarB field...
Hello,
I set up the validation rule when I designed Tables. Why the rule doesn't work in some Forms and sometimes does work? I know that I can add the validation rule in the property of the text box again. But is there any way the Form will take all validation rules from the Table?
Thank you.
Hello,
This question may be very stupid. I know that using index is easier to find a record in a database. Since the primary key is unique and can not be duplicated, if the primary key is the index, why do we need other fields to be index? Is it enough that I only assign the primary key to...
Hello,
I created forms from queries for data entry. Is it possible to have another person to enter data for the second time into the same database, and let the database itself check the agreement of the two entries? I hope that for every field the second person enters data, the database will...
Thank you.
In a moudle, I have:
Global strID As Long
First Form:
Private Sub ID_AfterUpdate()
strID = Me!ID
End Sub
Other forms:
Private Sub ID_Enter()
Me!ID = strID
End Sub
Also, in the property of ID: IME Sentence Mode = Phrase Predict
Now, when I enter data, the ID can be carried over...
I am a beginner and have no experience in VBA. Please bear with me.
Where do I put "Dim strID"? Like the following? It didn't work. I have the message that the variable strID is not defined. Could you tell me in more detail? Thank you very much.
Option Compare Database
Option...
Hello,
Due the capacity issue, I have to devide a questionnaire into several froms. I want the data entry person to enter the first record from the first form to the last form, then enter the second record. In addition, I hope he only needs to enter the ID for the first time, then when he...
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.