User Profile
Collapse
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessOh don't you worry, I will be back soon, And I wouldn't go anywhere else! :-) thanks again. -
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessAhh thank you!
You need to remove any .ControlSource values you have for your controls. Then it should work--even if your code returns null values.
Before
After
It Works! thanks twinnyfo!!!
...Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessCode:Dim intDad As Integer intDad = Nz(DLookup("MainID", "tblMain", "MainID= " & Me.cboMASTER), 0) Me.txtFather = Nz(DLookup("FullName", "tblMain", "MainID= " & intDad), "No Relative Found") End Sub
Produces this error
Shouldnt it be something like
Code:Me.txtFather.Value =
Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessThis is error is causing headaches! any ideas to get this to work? I have a feeling this is incomplete.
...Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessOk, tried solution
It just might work!!!!!
get an error
when value is zero?
So now I nneed to figure out Nz, and how to add it
maybe? or an if then else?
IsNull?
maybe like this?
Code:intDad = _ DLookup(Nz("FatherID", _ "tblMain", _ "MainID = " & Me.cboMaster))
Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin Accesstwinnyfo, yea busy weekend sorry for not getting back to you.
had to read up on Dlookup
I notice there are different formats for different data types
DLookup(Expr,Do main,[Criteria])
DLookup("FieldN ame" , "TableName" , "Criteria = n")
DLookup("FieldN ame" , "TableName" , "Criteria= 'string'")
DLookup("FieldN ame"...Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHi jimatqsi,
what if I where to use a nested Dlookup vs sql querys joined with unions?Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHi,
this looks like a SQL behind a query
yea ok that gives me ideas, and thanks.
but this is not a full clear concise answer or soultion
When it comes to applying this to VBA in ACCESS behind a form on load or combo box after update its not going to work.
what I am looking for is VBA in MS Access formatted with all of the qoutes and " & _ "'" etc etc
Here...Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHI
not worried about normalization, this will not be used in a production environment
adoptions are not a concern, surrogate pregnancies none, same sex couples not an issue (homosexuals do not procreate), incest (especially if you're building a family tree far back in time) yea there is some of that but its not a problemLeave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessNot a problem! relax.. are you done eating yet? so looking forward to it! refreashing the page.. lolLeave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHi twinnyfo, can you give me an example this would look like using instead Select From Where? 😎Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHi Jimatqsi
that sounds awesome! can you give a sample? template? your the man!Leave a comment:
-
gcoaster replied to VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessHi twinnyfo
Apreaciate taking the time to respond.
not a problem for me to write queries for each txtbox
Its keeping my access sql skills fresh, every IT job I have applied for this skill is a plus, and its a win win when i go back to work in IT after this covid19 passess (not too confident it will anytime soon but anyways)
would it look similour to this? (this is a rough example)
Code:Dim strtxtdad
Leave a comment:
-
gcoaster started a topic VBA Populates multiple Text Boxes from Table based on Combo Box Selection on Formin AccessVBA Populates multiple Text Boxes from Table based on Combo Box Selection on Form
Hi
I have one combo box (cboMASTER)
What I would love to do is select a name from this combo box and I would like about 20 text boxes to populate based on the value of column 0 in the combo box, that is the record ID
cboMASTER = 1,FullName
What the form will show is a family tree. And will show relatives based on who I select in a combo box cboMASTER
It will show mother, father, grand father etc... -
Your right, I corrected it [edit]
AttachmentDate; "
At least I took the time to post the solution for those in the future, that need help! Hope this helps someoneLeave a comment:
-
Here is the code that ended up working
Code:'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '\\\ a SQL Statement in VBA ACCESS using OR AND togeather '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '*********************************************************************** 'RecMainID = txtMainID 'RecChildID = cboCHILD 'RecSpouseID = cboSpouse1
Leave a comment:
-
-
Excellent! thank you twinnyfo
Exactly what I was looking for! I just have to replace AND with OR
I would also like to add
If Then Else ElseIf but i can figure this out.Leave a comment:
-
Populate a List Box on a Form using VBA SQL Statement If Then ElseIf
Hello All
First of all, I am totally hopeless in writing SQL correctly in VBA.
I will try and be as descriptive as I can possible be and attempt to use the correct terminology and correct VBA functions! ;-)
What I am attempting is populating a unbound list box (listRECORDS) on a form that populates using SQL on form Load
The form is frmMAIN and the source is tblMAIN
There is another... -
"*MultiReplace( )*(Let me know if you want that code.),"
YES!!
Thank you for thisLeave a comment:
No activity results to display
Show More
Leave a comment: