Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:38:13+00:00 2026-05-31T22:38:13+00:00

I have query table copyQuery which has Soil Condition has one of the columns,

  • 0

I have query table copyQuery which has Soil Condition has one of the columns, I need to make combo box soil_cond in another form to have default value of Soil Condition from copyQuery.

Combo box soil_cond has three values not a query.

So I tried this and entered the following to default value of the combo box soil_cond but it is not working.

=DLookUp("[Soil Condition]","copyQuery","soil_cond = [Soil Condition]")

Row Source is "Backfill";"Insitu"
Control Source is Soil Condition

copyQuery is table from this code:

Private Sub copy_record_Click()
  Dim query As String
  Dim qdfNew As QueryDef
  Dim dbLib As Database
  Set dbLib = CurrentDb()

  query1 = "Reference.Record_Num, Reference.[Report_Num], " & _
           "Reference.[Title], Reference.[Report_Date], " & _
           "Reference.[Author], Reference.[Organization], " & _
           "Reference.[Test Org], Reference.[Test Name], " & _
           "Reference.[Test Date], Reference.[POC]"

  query2 = "Soil_Properties.[Soil Condition], Soil_Properties.[USCS_Code]," & _
           "Soil_Properties.[Soil_C_Method], " & _
           "Soil_Properties.[Soil Compaction Method]," & _
           "Soil_Properties.[Custom Soil Compaction Method], " & _
           "Soil_Properties.[General Soil Classification], " & _
           "Soil_Properties.[Water Content Expedient], " & _
           "Soil_Properties.[Dry Density Expedient], Soil_Properties.[LL]," & _
           "Soil_Properties.[PL], Soil_Properties.[PI], " & _
           "Soil_Properties.[Per_Gravel], Soil_Properties.[Per_Sand], " & _
           "Soil_Properties.[Per_Clay], Soil_Properties.[Per_Silt], " & _
           "Soil_Properties.[Water_Cont], Soil_Properties.[Procedure 1], " & _
           "Soil_Properties.[Wet_Dens], Soil_Properties.[Procedure 2], " & _
           "Soil_Properties.[Dry_Dens], Soil_Properties.[Procedure 3]," & _
           "Soil_Properties.[Dens_Units], Soil_Properties.[Spec_Gravity]," & _
           "Soil_Properties.[Gradation Curve File], " & _
           "Soil_Properties.[Compaction Curve File]"

  query3 = "Charge_Type.[Charge_Type],Charge_Type.[Charge_Comp]," & _
           "Charge_Type.[General_Purpose_Bomb_Type], " & _
           "Charge_Type.[Artillery Round Type], " & _
           "Charge_Type.[Mortar Round Type]," & _
           "Charge_Type.[Charge_Shape], Charge_Type.[Charge_Length], " & _
           "Charge_Type.[Charge_Width], Charge_Type.[Charge_Thickness], " & _
           "Charge_Type.[Charge_Radius], Charge_Type.[Charge_Weight], " & _
           "Charge_Type.[Weapon_Category], Charge_Type.[Cased?], " & _
           "Charge_Type.[Case_Type], Charge_Type.[Case_Length], " & _
           "Charge_Type.[Case_In_Dia], Charge_Type.[Case_Thick], " & _
           "Charge_Type.[Case_Weight]"

  query4 = "Crater_Measurement.[A_Depth], Crater_Measurement.[A_Width]," & _
           "Crater_Measurement.[Lip_to_Lip_Diameter], " & _
           "Crater_Measurement.[A_Lip_Ht], " & _
           "Crater_Measurement.[Crater_Side_Slope], " & _
           "Crater_Measurement.[Lip_to_Crater_Depth], " & _
           "Crater_Measurement.[Units], Crater_Measurement.[Volume], " & _
           "Crater_Measurement.[Apparent Surface Area], " & _
           "Crater_Measurement.[Photo North], " & _
           "Crater_Measurement.[Photo South]," & _
           "Crater_Measurement.[Photo East], " & _
           "Crater_Measurement.[Photo West], " & _
           "Crater_Measurement.[Profile (0 or 180)], " & _
           "Crater_Measurement.[Profile (45 or 225)], " & _
           "Crater_Measurement.[Profile (90 or 270)], " & _
           "Crater_Measurement.[Profile (135 or 315)], " & _
           "Crater_Measurement.[Point Cloud]"

  query5 = "Cover.[Cover Type], Cover.[Mass_Units], Cover.[Dist_Units], " & _
           "Cover.[Vehicle], Cover.[Vehicle_Dist_From_Surface], " & _
           "Cover.[Vehicle_Mass], Cover.[Vehicle_L], Cover.[Vehicle_W], " & _
           "Cover.[Vehicle_H], Cover.[Cover_Shape], Cover.[Cover_L]," & _
           "Cover.[Cover_W], Cover.[Cover_T], Cover.[Radius], " & _
           "Cover.[Cover_Mass], Cover.[x], Cover.[y], Cover.[z], " & _
           "Cover.[Dist_From_Surface]"

  query6 = "Charge_Position.[Depth_of_Burst], " & _
           "Charge_Position.[Depth_of_Burial], " & _
           "Charge_Position.[Charge Orientation]"

  queryHead = "SELECT "
  queryTail = " FROM Reference, Soil_Properties, Charge_Type, " & _
              "      Crater_Measurement, Cover, Charge_Position " & _
              " WHERE Reference.Record_Num = " & Me.Text17 & _
              "      And Soil_Properties.Record_Num =" & Me.Text17 & _
              "      And Charge_Type.Record_Num =" & Me.Text17 & _
              "      And Crater_Measurement.Record_Num =" & Me.Text17 & _
              "      And Cover.Record_Num =" & Me.Text17 & _
              "      And Charge_Position.Record_Num =" & Me.Text17

  finalQuery = queryHead
  finalQuery = finalQuery & query1
  finalQuery = finalQuery & ", " & query2
  finalQuery = finalQuery & ", " & query3
  finalQuery = finalQuery & ", " & query4
  finalQuery = finalQuery & ", " & query5
  finalQuery = finalQuery & ", " & query6
  finalQuery = finalQuery & queryTail

  dbLib.QueryDefs.Delete "copyQuery"
  Set qdfNew = dbLib.CreateQueryDef("copyQuery", finalQuery)
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:38:15+00:00Added an answer on May 31, 2026 at 10:38 pm

    Try the following:

    =DLookUp("[Soil Condition]","copyQuery","soil_cond ='" & [Soil Condition] & "'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in DB called TABLE_3 which has several columns....and I wanna
I have three table I need to query table 1,2 and 3 and select
I have a query in VBA that Adds a few columns to a table.
I have a query which searches two separate fields in the same table... looking
I have a query that does what i want joining table but i need
I need to have MySQL query like this one: UPDATE table_name SET 1 =
I'm trying to query a table which has a column that contains straight xml
I have a query in MS Access which creates a table from two subqueries.
I have this query: SELECT * FROM table WHERE field = 'abcd'; Table has
I have a table with columns one and two: a | x a |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.