UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Search, Access 2010    
 
   
rzw0wr
post Nov 6 2019, 10:39 PM
Post#1



Posts: 306
Joined: 28-March 12
From: Indiana


I have a form. Attached

I can not remember how to post code.

So a copy and paste of the code.
Private Sub cboSelectName_Date_AfterUpdate()

DoCmd.SearchForRecord , "", acFirst, "[FirstName] = " & "'" & Screen.ActiveControl & "'"
DoCmd.OpenForm "frmCharge", acNormal, "", ""

End Sub

Attached File  Invoice_form.png ( 31.74K )Number of downloads: 5


The Select Name and Date has 3 fields.
First Name, Last Name and a date

The cbo shows the first name after selection.

How can I get it to show all of the fields?

Also, on the form is a Work Date.
This date is in the cbo fields. #3

How can I get the cbo date field to show up in the form date field?


Thank you,
Dale

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 
June7
post Nov 7 2019, 12:35 AM
Post#2



Posts: 967
Joined: 25-January 16



Shouldn't you really do search on ID instead of first name?

Concatenate fields in combobox RowSource like:

SELECT ID, FirstName & " " & LastName & " : " & datefield & AS Data, FirstName, LastName, datefield FROM tablename;

Textbox can reference combobox column index. Index begins with 0 so datefield is in column 5 which is index 4: =comboboxname.Column(4)

Be sure to set combobox ColumnCount and ColumnWidths properties.

This post has been edited by June7: Nov 7 2019, 12:38 AM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
rzw0wr
post Nov 7 2019, 03:44 AM
Post#3



Posts: 306
Joined: 28-March 12
From: Indiana


Thank you june.

It gave me an idea on what I was doing wrong.

Dale

--------------------
Access 2010 32 bit.
Not really very good at access.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th November 2019 - 07:52 PM